-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest_cloud.py
27 lines (21 loc) · 971 Bytes
/
test_cloud.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
from pprint import pprint
from semver import VersionInfo
from balsa import get_logger
from pyship import PyShip, CLIP_EXT
from test_pyship import TstAppDirs, TST_APP_NAME
log = get_logger(TST_APP_NAME)
def test_cloud():
version = VersionInfo.parse("0.0.1")
tst_app_dirs = TstAppDirs(TST_APP_NAME, version)
py_ship = PyShip(tst_app_dirs.project_dir, dist_dir=tst_app_dirs.dist_dir)
py_ship.cloud_bucket = "testawsimple" # awsimple moto mock makes this
py_ship.cloud_profile = os.environ.get("CLOUD_PROFILE", "default") # since we're using moto to mock we don't need a real profile
log.info(f"{py_ship.cloud_profile=}")
py_ship.ship()
uploaded_files = py_ship.cloud_access.s3_access.dir()
pprint(uploaded_files)
clip_file_name = f"{TST_APP_NAME}_{version}.{CLIP_EXT}"
assert clip_file_name in uploaded_files
installer_name = f"{TST_APP_NAME}_installer_win64.exe"
assert installer_name in uploaded_files