amapy 1.0.2.dev2__py3-none-any.whl → 1.1.0.dev4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amapy/app.py +1 -1
- amapy/commands/alias_actions/alias_add.py +1 -1
- amapy/commands/alias_actions/alias_help.py +2 -2
- amapy/commands/alias_actions/alias_info.py +2 -2
- amapy/commands/alias_actions/alias_remove.py +2 -2
- amapy/commands/alias_actions/alias_set.py +2 -2
- amapy/commands/asset_actions/__init__.py +2 -0
- amapy/commands/asset_actions/add.py +2 -2
- amapy/commands/asset_actions/commit.py +11 -14
- amapy/commands/asset_actions/diff.py +27 -24
- amapy/commands/asset_actions/discard.py +1 -1
- amapy/commands/asset_actions/join.py +29 -0
- amapy/commands/asset_actions/tests/test_asset_cmds.py +10 -10
- amapy/commands/asset_actions/update.py +1 -1
- amapy/commands/asset_class_actions/list.py +0 -6
- amapy/commands/cli_option.py +1 -1
- amapy/commands/cmd_group.py +2 -2
- amapy/commands/parser.py +4 -4
- amapy/commands/refs_actions/ref_add.py +1 -1
- amapy/python_api/artifact.py +5 -5
- amapy/python_api/file.py +5 -1
- amapy/python_api/tests/test_artifact.py +39 -68
- amapy/python_api/tests/test_file.py +31 -0
- amapy/python_api/tests/test_klass.py +15 -11
- amapy/python_api/tests/test_project.py +22 -13
- {amapy-1.0.2.dev2.dist-info → amapy-1.1.0.dev4.dist-info}/METADATA +12 -13
- {amapy-1.0.2.dev2.dist-info → amapy-1.1.0.dev4.dist-info}/RECORD +30 -29
- {amapy-1.0.2.dev2.dist-info → amapy-1.1.0.dev4.dist-info}/WHEEL +1 -1
- amapy/python_api/tests/test_auth.py +0 -37
- {amapy-1.0.2.dev2.dist-info → amapy-1.1.0.dev4.dist-info}/entry_points.txt +0 -0
- {amapy-1.0.2.dev2.dist-info → amapy-1.1.0.dev4.dist-info}/top_level.txt +0 -0
amapy/app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from amapy.commands import CliAction
|
|
1
|
+
from amapy.commands import CliAction
|
|
2
2
|
from amapy_utils.common.user_commands import UserCommands
|
|
3
3
|
|
|
4
4
|
|
|
@@ -13,5 +13,5 @@ class AliasHelp(CliAction):
|
|
|
13
13
|
msg += f"{UserCommands().alias_info()}\n"
|
|
14
14
|
self.user_log.message(msg)
|
|
15
15
|
|
|
16
|
-
def get_options(self)
|
|
16
|
+
def get_options(self):
|
|
17
17
|
return []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from amapy.commands import CliAction
|
|
1
|
+
from amapy.commands import CliAction
|
|
2
2
|
from amapy_core.api.repo_api import AssetAPI
|
|
3
3
|
|
|
4
4
|
|
|
@@ -11,5 +11,5 @@ class AliasInfo(CliAction):
|
|
|
11
11
|
with api.environment():
|
|
12
12
|
api.list_alias()
|
|
13
13
|
|
|
14
|
-
def get_options(self)
|
|
14
|
+
def get_options(self):
|
|
15
15
|
return []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from amapy.commands import CliAction
|
|
1
|
+
from amapy.commands import CliAction
|
|
2
2
|
from amapy_core.api.repo_api import AssetAPI
|
|
3
3
|
|
|
4
4
|
|
|
@@ -11,5 +11,5 @@ class RemoveAlias(CliAction):
|
|
|
11
11
|
with api.environment():
|
|
12
12
|
api.remove_alias()
|
|
13
13
|
|
|
14
|
-
def get_options(self)
|
|
14
|
+
def get_options(self):
|
|
15
15
|
return []
|
|
@@ -8,13 +8,13 @@ class SetAlias(CliAction):
|
|
|
8
8
|
|
|
9
9
|
def run(self, args):
|
|
10
10
|
if not args.alias:
|
|
11
|
-
self.user_log.error("missing
|
|
11
|
+
self.user_log.error("missing required parameter <alias>")
|
|
12
12
|
return
|
|
13
13
|
api = AssetAPI(self.repo).add
|
|
14
14
|
with api.environment():
|
|
15
15
|
api.add_alias(args.alias)
|
|
16
16
|
|
|
17
|
-
def get_options(self) -> [CliOption]:
|
|
17
|
+
def get_options(self) -> list[CliOption]:
|
|
18
18
|
return [
|
|
19
19
|
CliOption(
|
|
20
20
|
dest="alias",
|
|
@@ -14,6 +14,7 @@ from .hash import ComputeHashAction
|
|
|
14
14
|
from .history import AssetHistory
|
|
15
15
|
from .info import AssetInfo
|
|
16
16
|
from .init import InitAsset
|
|
17
|
+
from .join import AssetJoin
|
|
17
18
|
from .list import ListAssets
|
|
18
19
|
from .pull import AssetPull
|
|
19
20
|
from .remote import RemoteInfo
|
|
@@ -60,6 +61,7 @@ def get_actions():
|
|
|
60
61
|
DebugAsset(),
|
|
61
62
|
CopyObject(),
|
|
62
63
|
AssetPull(),
|
|
64
|
+
AssetJoin(),
|
|
63
65
|
|
|
64
66
|
# AssetDelete(),
|
|
65
67
|
# AssetRestore()
|
|
@@ -24,7 +24,7 @@ class AddToAsset(CliAction):
|
|
|
24
24
|
if args.credentials:
|
|
25
25
|
os.unsetenv("ASSET_CREDENTIALS")
|
|
26
26
|
|
|
27
|
-
def get_options(self) -> [CliOption]:
|
|
27
|
+
def get_options(self) -> list[CliOption]:
|
|
28
28
|
return [
|
|
29
29
|
CliOption(
|
|
30
30
|
dest="target",
|
|
@@ -68,5 +68,5 @@ class AddToAsset(CliAction):
|
|
|
68
68
|
is_boolean=True,
|
|
69
69
|
short_name="f",
|
|
70
70
|
full_name="force"
|
|
71
|
-
)
|
|
71
|
+
)
|
|
72
72
|
]
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import cached_property
|
|
2
|
-
|
|
3
1
|
from amapy.commands import CliAction, CliOption
|
|
4
|
-
from amapy_core.api.repo_api import AssetAPI
|
|
2
|
+
from amapy_core.api.repo_api import AssetAPI
|
|
5
3
|
|
|
6
4
|
|
|
7
5
|
class CommitMessage(CliAction):
|
|
8
6
|
name = "commit"
|
|
9
7
|
help_msg = "commit message for the changes"
|
|
10
8
|
|
|
11
|
-
@cached_property.cached_property
|
|
12
|
-
def api(self) -> AddAPI:
|
|
13
|
-
return AssetAPI(self.repo).add
|
|
14
|
-
|
|
15
9
|
def run(self, args):
|
|
16
10
|
if args.message:
|
|
17
|
-
|
|
11
|
+
api = AssetAPI(self.repo).add
|
|
12
|
+
with api.environment():
|
|
13
|
+
api.add_commit_message(message=args.message)
|
|
18
14
|
else:
|
|
19
15
|
self.user_log.message("missing commit message, please use asset commit -m <message text>")
|
|
20
16
|
|
|
21
|
-
def get_options(self):
|
|
17
|
+
def get_options(self) -> list[CliOption]:
|
|
22
18
|
return [
|
|
23
|
-
CliOption(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
CliOption(
|
|
20
|
+
dest="message",
|
|
21
|
+
help_msg="commit message",
|
|
22
|
+
short_name="m",
|
|
23
|
+
full_name="message"
|
|
24
|
+
)
|
|
28
25
|
]
|
|
@@ -7,33 +7,36 @@ class AssetDiff(CliAction):
|
|
|
7
7
|
help_msg = "Displays the differences between two versions of an asset"
|
|
8
8
|
|
|
9
9
|
def run(self, args):
|
|
10
|
-
print(f"args: {args.__dict__}")
|
|
11
10
|
api = AssetAPI(self.repo).diff
|
|
12
11
|
with api.environment():
|
|
13
12
|
api.diff(file=args.file, src_ver=args.src_ver, dst_ver=args.dst_ver, html=args.html)
|
|
14
13
|
|
|
15
|
-
def get_options(self):
|
|
14
|
+
def get_options(self) -> list[CliOption]:
|
|
16
15
|
return [
|
|
17
|
-
CliOption(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
16
|
+
CliOption(
|
|
17
|
+
dest="src_ver",
|
|
18
|
+
short_name="s",
|
|
19
|
+
full_name="src",
|
|
20
|
+
help_msg="src version",
|
|
21
|
+
n_args="?",
|
|
22
|
+
),
|
|
23
|
+
CliOption(
|
|
24
|
+
dest="dst_ver",
|
|
25
|
+
short_name="d",
|
|
26
|
+
full_name="dst",
|
|
27
|
+
help_msg="dst version",
|
|
28
|
+
n_args="?",
|
|
29
|
+
),
|
|
30
|
+
CliOption(
|
|
31
|
+
dest="file",
|
|
32
|
+
short_name="f",
|
|
33
|
+
full_name="file",
|
|
34
|
+
help_msg="file path",
|
|
35
|
+
n_args="?",
|
|
36
|
+
),
|
|
37
|
+
CliOption(
|
|
38
|
+
dest="html",
|
|
39
|
+
help_msg="if true diff is shown as html",
|
|
40
|
+
is_boolean=True
|
|
41
|
+
)
|
|
39
42
|
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from amapy.commands import CliAction, CliOption
|
|
2
|
+
from amapy_core.api.settings_api import SettingsAPI
|
|
3
|
+
from amapy_utils.common.user_commands import UserCommands
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AssetJoin(CliAction):
|
|
7
|
+
name = "join"
|
|
8
|
+
help_msg = "Set the server url"
|
|
9
|
+
requires_repo = False
|
|
10
|
+
requires_store = False
|
|
11
|
+
requires_auth = False
|
|
12
|
+
|
|
13
|
+
def run(self, args):
|
|
14
|
+
if not args.server_url:
|
|
15
|
+
self.user_log.alert("missing required parameter server_url")
|
|
16
|
+
self.user_log.message(UserCommands().clone_asset())
|
|
17
|
+
return
|
|
18
|
+
|
|
19
|
+
SettingsAPI().set_user_configs({"server_url": args.server_url})
|
|
20
|
+
|
|
21
|
+
def get_options(self):
|
|
22
|
+
return [
|
|
23
|
+
CliOption(
|
|
24
|
+
dest="server_url",
|
|
25
|
+
help_msg="the AMA server url to connect to",
|
|
26
|
+
positional=True,
|
|
27
|
+
n_args="?",
|
|
28
|
+
),
|
|
29
|
+
]
|
|
@@ -26,32 +26,32 @@ def test_asset_actions():
|
|
|
26
26
|
CloneAsset()
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
args = parser.parse_args(["add", "myfile.txt"])
|
|
29
|
+
args, _ = parser.parse_args(["add", "myfile.txt"])
|
|
30
30
|
assert args.group == "add" and args.target == ["myfile.txt"]
|
|
31
31
|
|
|
32
|
-
args = parser.parse_args(["remove", "myfile.txt", "1.log"])
|
|
32
|
+
args, _ = parser.parse_args(["remove", "myfile.txt", "1.log"])
|
|
33
33
|
assert args.group == "remove" and args.target == ["myfile.txt", "1.log"]
|
|
34
34
|
|
|
35
|
-
args = parser.parse_args(["init"])
|
|
35
|
+
args, _ = parser.parse_args(["init"])
|
|
36
36
|
assert args.group == "init"
|
|
37
37
|
|
|
38
|
-
args = parser.parse_args(["init", "genetics"])
|
|
38
|
+
args, _ = parser.parse_args(["init", "genetics"])
|
|
39
39
|
assert args.group == "init" and args.class_name == "genetics"
|
|
40
40
|
|
|
41
|
-
args = parser.parse_args(["upload"])
|
|
41
|
+
args, _ = parser.parse_args(["upload"])
|
|
42
42
|
assert args.group == "upload" and not args.message
|
|
43
43
|
|
|
44
|
-
args = parser.parse_args(["upload", "-m", "first commit"])
|
|
44
|
+
args, _ = parser.parse_args(["upload", "-m", "first commit"])
|
|
45
45
|
assert args.group == "upload" and args.message == "first commit"
|
|
46
46
|
|
|
47
|
-
args = parser.parse_args(["upload", "--message", "second commit"])
|
|
47
|
+
args, _ = parser.parse_args(["upload", "--message", "second commit"])
|
|
48
48
|
assert args.group == "upload" and args.message == "second commit"
|
|
49
49
|
|
|
50
|
-
args = parser.parse_args(["download"])
|
|
50
|
+
args, _ = parser.parse_args(["download"])
|
|
51
51
|
assert args.group == "download"
|
|
52
52
|
|
|
53
|
-
args = parser.parse_args(["info", "--hash"])
|
|
53
|
+
args, _ = parser.parse_args(["info", "--hash"])
|
|
54
54
|
assert args.group == "info"
|
|
55
55
|
|
|
56
|
-
args = parser.parse_args(["clone", "model_visualizations/1"])
|
|
56
|
+
args, _ = parser.parse_args(["clone", "model_visualizations/1"])
|
|
57
57
|
assert args.group == "clone"
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import cached_property
|
|
2
|
-
|
|
3
1
|
from amapy.commands import CliAction
|
|
4
2
|
from amapy_core.api.store_api.list import ListAPI
|
|
5
3
|
|
|
@@ -16,7 +14,3 @@ class ListAssetClass(CliAction):
|
|
|
16
14
|
|
|
17
15
|
def get_options(self):
|
|
18
16
|
return []
|
|
19
|
-
|
|
20
|
-
@cached_property.cached_property
|
|
21
|
-
def api(self):
|
|
22
|
-
return ListAPI(store=self.asset_store, repo=self.repo)
|
amapy/commands/cli_option.py
CHANGED
amapy/commands/cmd_group.py
CHANGED
|
@@ -36,8 +36,8 @@ class CommandGroup(BaseAction):
|
|
|
36
36
|
description=self.description,
|
|
37
37
|
formatter_class=parent.formatter_class,
|
|
38
38
|
)
|
|
39
|
-
cmd_sub_parser = group_parser.add_subparsers(metavar=
|
|
40
|
-
dest=
|
|
39
|
+
cmd_sub_parser = group_parser.add_subparsers(metavar="actions",
|
|
40
|
+
dest="action")
|
|
41
41
|
for action in self.actions.values():
|
|
42
42
|
action.add_parser(sub_parsers=cmd_sub_parser)
|
|
43
43
|
|
amapy/commands/parser.py
CHANGED
|
@@ -7,7 +7,7 @@ from amapy_utils.utils.log_utils import LoggingMixin
|
|
|
7
7
|
class DefaultHelpParser(ArgumentParser):
|
|
8
8
|
|
|
9
9
|
def error(self, message):
|
|
10
|
-
sys.stderr.write(
|
|
10
|
+
sys.stderr.write("error in command: %s\n" % message)
|
|
11
11
|
self.print_help()
|
|
12
12
|
sys.exit(2)
|
|
13
13
|
|
|
@@ -40,7 +40,7 @@ class DefaultHelpParser(ArgumentParser):
|
|
|
40
40
|
class NewLineFormatter(RawTextHelpFormatter):
|
|
41
41
|
def _split_lines(self, text: str, width):
|
|
42
42
|
# print(f"splitting lines: {text}")
|
|
43
|
-
if text.endswith(
|
|
43
|
+
if text.endswith("\n"):
|
|
44
44
|
return text[2:].splitlines()
|
|
45
45
|
return super()._split_lines(text, width=width)
|
|
46
46
|
|
|
@@ -60,10 +60,10 @@ class CommandParser(LoggingMixin):
|
|
|
60
60
|
description=self.user_log.colorize("Asset Manager Command Line Tool",
|
|
61
61
|
color=self.user_log.colors.cyan),
|
|
62
62
|
formatter_class=NewLineFormatter,
|
|
63
|
-
epilog=self.user_log.colorize(
|
|
63
|
+
epilog=self.user_log.colorize("Command Line tool for interacting with assets",
|
|
64
64
|
color=self.user_log.colors.cyan)
|
|
65
65
|
)
|
|
66
|
-
sub_parsers = self.parser.add_subparsers(metavar=
|
|
66
|
+
sub_parsers = self.parser.add_subparsers(metavar="groups", dest="group")
|
|
67
67
|
sub_parsers.required = True
|
|
68
68
|
self.sub_parsers = sub_parsers
|
|
69
69
|
|
|
@@ -32,7 +32,7 @@ class AddRef(CliAction):
|
|
|
32
32
|
self.user_log.message(UserCommands().inputs_add())
|
|
33
33
|
self.user_log.message(UserCommands().inputs_add_remote())
|
|
34
34
|
|
|
35
|
-
def get_options(self) -> [CliOption]:
|
|
35
|
+
def get_options(self) -> list[CliOption]:
|
|
36
36
|
return [
|
|
37
37
|
CliOption(
|
|
38
38
|
dest="input_asset",
|
amapy/python_api/artifact.py
CHANGED
|
@@ -187,14 +187,14 @@ class Artifact:
|
|
|
187
187
|
@property
|
|
188
188
|
def is_temp(self) -> bool:
|
|
189
189
|
"""Returns True if the asset is temporary."""
|
|
190
|
-
return self.info.get(
|
|
190
|
+
return self.info.get("asset").get("cloning") == (False, "temp_asset")
|
|
191
191
|
|
|
192
192
|
@cached_property
|
|
193
193
|
def inputs(self) -> ArtifactInputs:
|
|
194
194
|
from amapy import ArtifactInputs
|
|
195
195
|
return ArtifactInputs(artifact=self)
|
|
196
196
|
|
|
197
|
-
def sanitize_targets(self, targets: [str], copy_to_asset: bool = False) -> [str]:
|
|
197
|
+
def sanitize_targets(self, targets: list[str], copy_to_asset: bool = False) -> list[str]:
|
|
198
198
|
"""
|
|
199
199
|
Checks if the target files are within the asset directory, if not, then copies the files to the asset directory
|
|
200
200
|
based on the force flag and returns the sanitized list of targets.
|
|
@@ -214,7 +214,7 @@ class Artifact:
|
|
|
214
214
|
filtered_targets.append(target)
|
|
215
215
|
return filtered_targets
|
|
216
216
|
|
|
217
|
-
def add(self, targets: [str], proxy: bool = False, copy_to_asset: bool = False, force: bool = False):
|
|
217
|
+
def add(self, targets: list[str], proxy: bool = False, copy_to_asset: bool = False, force: bool = False):
|
|
218
218
|
"""Adds files and directories to the asset.
|
|
219
219
|
|
|
220
220
|
Parameters
|
|
@@ -242,7 +242,7 @@ class Artifact:
|
|
|
242
242
|
with ch_dir(self.path):
|
|
243
243
|
api.add_files(targets=sanitized_targets, prompt_user=False, proxy=proxy, force=force)
|
|
244
244
|
|
|
245
|
-
def add_remote(self, targets: [str], credentials: str = None):
|
|
245
|
+
def add_remote(self, targets: list[str], credentials: str = None):
|
|
246
246
|
"""Adds remote files to the asset.
|
|
247
247
|
|
|
248
248
|
Parameters
|
|
@@ -608,7 +608,7 @@ class Artifact:
|
|
|
608
608
|
# Custom key function to sort by integer id and then version
|
|
609
609
|
def sort_key(name):
|
|
610
610
|
# Split the string by '/' and extract parts
|
|
611
|
-
parts = name.split(
|
|
611
|
+
parts = name.split("/")
|
|
612
612
|
return parts[0], int(parts[1]), tuple(map(int, parts[2].split(".")))
|
|
613
613
|
|
|
614
614
|
# Sort the existing assets by the custom key function
|
amapy/python_api/file.py
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import tempfile
|
|
3
|
+
|
|
1
4
|
import pytest
|
|
2
5
|
|
|
3
6
|
from amapy.python_api.artifact import Artifact, File
|
|
4
7
|
from amapy_utils.common import exceptions
|
|
5
8
|
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
print(asset_root)
|
|
14
|
-
print(repo)
|
|
15
|
-
print(asset)
|
|
16
|
-
print(store)
|
|
17
|
-
print(empty_asset)
|
|
18
|
-
|
|
19
|
-
artifact = Artifact(path=repo.fs_path)
|
|
20
|
-
info = artifact.info
|
|
21
|
-
print(info)
|
|
10
|
+
def test_fixtures(asset_root, repo, asset, store):
|
|
11
|
+
"""Verify that all conftest fixtures are created properly."""
|
|
12
|
+
assert asset_root and os.path.isdir(asset_root)
|
|
13
|
+
assert repo is not None
|
|
14
|
+
assert asset is not None
|
|
15
|
+
assert store is not None
|
|
22
16
|
|
|
23
17
|
|
|
24
18
|
def test_init():
|
|
@@ -28,20 +22,25 @@ def test_init():
|
|
|
28
22
|
assert e.type == exceptions.AssetException
|
|
29
23
|
|
|
30
24
|
# also raise exception if not a valid repo
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
temp_dir = tempfile.mkdtemp()
|
|
26
|
+
try:
|
|
27
|
+
with pytest.raises(Exception) as e:
|
|
28
|
+
Artifact(path=temp_dir)
|
|
29
|
+
assert e.type == exceptions.NotAssetRepoError
|
|
30
|
+
finally:
|
|
31
|
+
os.rmdir(temp_dir)
|
|
34
32
|
|
|
35
33
|
|
|
36
34
|
def test_info(asset):
|
|
37
35
|
artifact = Artifact(path=asset.repo.fs_path)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
info = artifact.info
|
|
37
|
+
info_keys = ["asset", "objects"]
|
|
38
|
+
for key in info_keys:
|
|
39
|
+
assert key in info
|
|
41
40
|
|
|
42
41
|
# objects
|
|
43
42
|
object_keys = ["linked_path", "path", "size", "cloned"]
|
|
44
|
-
for item in
|
|
43
|
+
for item in info.get("objects"):
|
|
45
44
|
for key in object_keys:
|
|
46
45
|
assert key in item
|
|
47
46
|
|
|
@@ -52,59 +51,31 @@ def test_versions(asset):
|
|
|
52
51
|
assert versions is None # local asset
|
|
53
52
|
|
|
54
53
|
|
|
55
|
-
def test_history(
|
|
56
|
-
artifact = Artifact(path=
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
def test_history(asset):
|
|
55
|
+
artifact = Artifact(path=asset.repo.fs_path)
|
|
56
|
+
history = artifact.history
|
|
57
|
+
assert history is None # local asset
|
|
59
58
|
|
|
60
59
|
|
|
61
60
|
def test_status(asset):
|
|
62
|
-
|
|
63
|
-
artifact = Artifact(path=str(asset.repo))
|
|
61
|
+
artifact = Artifact(path=asset.repo.fs_path)
|
|
64
62
|
status = artifact.status
|
|
65
|
-
|
|
63
|
+
status_keys = ["staged_changes", "unstaged_changes", "untracked_changes"]
|
|
64
|
+
for key in status_keys:
|
|
65
|
+
assert key in status
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
def test_files(asset):
|
|
69
|
-
|
|
70
|
-
artifact = Artifact(path=str(asset.repo))
|
|
69
|
+
artifact = Artifact(path=asset.repo.fs_path)
|
|
71
70
|
files = artifact.files
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
for item in files.values():
|
|
72
|
+
assert isinstance(item, File)
|
|
74
73
|
|
|
75
|
-
def test_read_file():
|
|
76
|
-
path = "/Users/mahantis/am_demo/dsaswe_test/24"
|
|
77
|
-
artifact = Artifact(path=path)
|
|
78
|
-
file: File = artifact.files.get("info-test.txt")
|
|
79
|
-
with file.open() as f:
|
|
80
|
-
contents = f.read()
|
|
81
|
-
print(contents)
|
|
82
74
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def test_find_hash():
|
|
91
|
-
# find with hash
|
|
92
|
-
asset_names = Artifact.find(class_name="swarup_data", hash="12adc50b32d57b3d17cc829e4cd02c2b")
|
|
93
|
-
assert asset_names and asset_names[0] == "swarup_data/1/0.0.0"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
def test_clone():
|
|
97
|
-
artifact = Artifact.clone(name="swarup_data/1", path="/Users/mahantis/am_demo/swarup_data/1")
|
|
98
|
-
print(artifact)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def test_sort_key():
|
|
102
|
-
asset_names = ["swarup_data/3/2.1.9", "swarup_data/3/2.10.0", "swarup_data/1/10.0.2"]
|
|
103
|
-
|
|
104
|
-
def sort_key(name):
|
|
105
|
-
# Split the string by '/' and extract parts
|
|
106
|
-
parts = name.split('/')
|
|
107
|
-
return parts[0], int(parts[1]), tuple(map(int, parts[2].split(".")))
|
|
108
|
-
|
|
109
|
-
asset_names.sort(key=sort_key)
|
|
110
|
-
assert asset_names[-1] == "swarup_data/3/2.10.0"
|
|
75
|
+
def test_read_file(asset):
|
|
76
|
+
artifact = Artifact(path=asset.repo.fs_path)
|
|
77
|
+
files = artifact.files
|
|
78
|
+
for item in files.values():
|
|
79
|
+
with item.open() as f:
|
|
80
|
+
file_contents = f.read()
|
|
81
|
+
assert file_contents is not None
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from amapy.python_api.file import File
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_str_returns_linked_path(tmp_path):
|
|
7
|
+
test_path = tmp_path / "example.txt"
|
|
8
|
+
file = File(path=str(test_path), linked_path=str(test_path), cloned=False, size=0)
|
|
9
|
+
assert str(file) == str(test_path)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_open_reads_file_contents(tmp_path):
|
|
13
|
+
test_path = tmp_path / "readme.txt"
|
|
14
|
+
test_path.write_text("hello", encoding="utf-8")
|
|
15
|
+
|
|
16
|
+
file = File(path=str(test_path), linked_path=str(test_path), cloned=False, size=test_path.stat().st_size)
|
|
17
|
+
with file.open() as f:
|
|
18
|
+
assert f.read() == "hello"
|
|
19
|
+
assert not f.closed
|
|
20
|
+
|
|
21
|
+
assert f.closed
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_open_writes_file_contents(tmp_path):
|
|
25
|
+
test_path = tmp_path / "write.txt"
|
|
26
|
+
file = File(path=str(test_path), linked_path=str(test_path), cloned=False, size=0)
|
|
27
|
+
|
|
28
|
+
with file.open(mode="w") as f:
|
|
29
|
+
f.write("data")
|
|
30
|
+
|
|
31
|
+
assert test_path.read_text(encoding="utf-8") == "data"
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
+
from unittest.mock import patch
|
|
2
|
+
|
|
1
3
|
from amapy.python_api.klass import Klass
|
|
2
4
|
|
|
3
5
|
|
|
4
|
-
def test_list():
|
|
5
|
-
klass =
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def test_list(store):
|
|
7
|
+
with patch("amapy.python_api.klass.AssetStore.shared", return_value=store):
|
|
8
|
+
klass = Klass()
|
|
9
|
+
class_list = klass.list()
|
|
10
|
+
assert class_list and type(class_list) is dict
|
|
8
11
|
|
|
9
12
|
|
|
10
|
-
def test_info():
|
|
11
|
-
klass =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
def test_info(store):
|
|
14
|
+
with patch("amapy.python_api.klass.AssetStore.shared", return_value=store):
|
|
15
|
+
klass = Klass()
|
|
16
|
+
class_info = klass.info(class_name="test_class")
|
|
17
|
+
assert type(class_info) is dict
|
|
18
|
+
expected = ["name", "id", "created_at", "created_by", "class_type", "project"]
|
|
19
|
+
for key in expected:
|
|
20
|
+
assert key in class_info
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
+
from unittest.mock import patch
|
|
2
|
+
|
|
1
3
|
from amapy.python_api.project import Project
|
|
4
|
+
from amapy_core.configs.app_settings import AppSettings
|
|
2
5
|
|
|
3
6
|
|
|
4
|
-
def test_list():
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
def test_list(test_environment):
|
|
8
|
+
settings = AppSettings.shared()
|
|
9
|
+
settings.data = AppSettings.validate(data=test_environment)
|
|
10
|
+
with patch("amapy_core.api.settings_api.AppSettings.shared", return_value=settings):
|
|
11
|
+
project_list = Project().list()
|
|
12
|
+
assert len(project_list) == len(test_environment.get("projects"))
|
|
13
|
+
expected_keys = ["name", "id", "description", "remote_url", "is_active"]
|
|
14
|
+
for project in project_list:
|
|
15
|
+
for key in expected_keys:
|
|
16
|
+
assert key in project
|
|
11
17
|
|
|
12
18
|
|
|
13
|
-
def test_active_project():
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
assert
|
|
19
|
+
def test_active_project(test_environment):
|
|
20
|
+
settings = AppSettings.shared()
|
|
21
|
+
settings.data = AppSettings.validate(data=test_environment)
|
|
22
|
+
with patch("amapy_core.api.settings_api.AppSettings.shared", return_value=settings):
|
|
23
|
+
active_project = Project().active
|
|
24
|
+
assert isinstance(active_project, dict)
|
|
25
|
+
expected_keys = ["name", "id", "description", "remote_url", "is_active"]
|
|
26
|
+
for key in expected_keys:
|
|
27
|
+
assert key in active_project
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: amapy
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.1.0.dev4
|
|
4
4
|
Summary: The client side tool for ama project.
|
|
5
5
|
Author-email: Swarup Mahanti <swarup.mahanti@roche.com>
|
|
6
6
|
Maintainer-email: Swarup Mahanti <swarup.mahanti@roche.com>
|
|
7
7
|
License: Copyright (c) 2024 Roche Diagnostics Computation Science & Informatics
|
|
8
|
-
Requires-Python: <3.
|
|
8
|
+
Requires-Python: <3.13,>=3.12
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
|
-
Requires-Dist: amapy-contents==1.0
|
|
11
|
-
Requires-Dist: amapy-core==1.0
|
|
12
|
-
Requires-Dist: amapy-db==1.0
|
|
13
|
-
Requires-Dist: amapy-pluggy==1.0
|
|
14
|
-
Requires-Dist: amapy-plugin-gcr==1.0
|
|
15
|
-
Requires-Dist: amapy-plugin-gcs==1.0
|
|
16
|
-
Requires-Dist: amapy-plugin-posix==1.0
|
|
17
|
-
Requires-Dist: amapy-plugin-s3==1.0
|
|
18
|
-
Requires-Dist: amapy-utils==1.0
|
|
19
|
-
Requires-Dist: markupsafe==2.1.*
|
|
10
|
+
Requires-Dist: amapy-contents==1.1.0
|
|
11
|
+
Requires-Dist: amapy-core==1.1.0
|
|
12
|
+
Requires-Dist: amapy-db==1.1.0
|
|
13
|
+
Requires-Dist: amapy-pluggy==1.1.0
|
|
14
|
+
Requires-Dist: amapy-plugin-gcr==1.1.0
|
|
15
|
+
Requires-Dist: amapy-plugin-gcs==1.1.0
|
|
16
|
+
Requires-Dist: amapy-plugin-posix==1.1.0
|
|
17
|
+
Requires-Dist: amapy-plugin-s3==1.1.0
|
|
18
|
+
Requires-Dist: amapy-utils==1.1.0
|
|
20
19
|
|
|
21
20
|
# amapy
|
|
22
21
|
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
amapy/__init__.py,sha256=p-lUNuNkXf7K7B30wyKT1NXfDLsugBfauZ3hDUIwf5I,167
|
|
2
|
-
amapy/app.py,sha256=
|
|
2
|
+
amapy/app.py,sha256=ZAEvRGIxFulm4V03RPmCZh9TuYMCNjY0MeHrFemr3wo,426
|
|
3
3
|
amapy/app_debug.py,sha256=oSW_vR35t0SgoaRZ3E6CgLQF3rUvFnKy4MORIQuV02Q,732
|
|
4
4
|
amapy/arg_parse.py,sha256=I3RE9mMdDNhVNiRc1WSC0W0kGoayzWsmbn5N21k1MBQ,2011
|
|
5
5
|
amapy/plugins.py,sha256=z5csYG4FW49EnjJaHfYdoXCpycjgfnYZMx-F0Tn3ClY,761
|
|
6
6
|
amapy/commands/__init__.py,sha256=amq4VMaS8aLdbjiWIWGdXsBv9SriLZwXjKSIYX2Mhdg,104
|
|
7
7
|
amapy/commands/base_action.py,sha256=O3Dv7pEPfPTW_axffW77DOYVpi9O0_Icq8dJI35MTxs,2615
|
|
8
8
|
amapy/commands/cli_action.py,sha256=A14a54SUKmgTSrJO53f2J66yucMKQYTkNz9lrEzudUw,842
|
|
9
|
-
amapy/commands/cli_option.py,sha256=
|
|
10
|
-
amapy/commands/cmd_group.py,sha256
|
|
11
|
-
amapy/commands/parser.py,sha256=
|
|
9
|
+
amapy/commands/cli_option.py,sha256=mtrzs7bgOXCq7AmqD5SBouMiyvtk_YijRQ4gBdfhhSs,1489
|
|
10
|
+
amapy/commands/cmd_group.py,sha256=FPtZmsY9ES_cNU4VxXCa30CwRgCMBfN64PXLEl3W7zs,1709
|
|
11
|
+
amapy/commands/parser.py,sha256=9UuPESumEa2Zb1n333hsyu04TbyZ3lA-zrfFRk490BQ,2987
|
|
12
12
|
amapy/commands/alias_actions/__init__.py,sha256=78B_nATF2WgUGBJL-HhuU__AhJT3XaetN4wSjFhCcA4,798
|
|
13
|
-
amapy/commands/alias_actions/alias_add.py,sha256=
|
|
14
|
-
amapy/commands/alias_actions/alias_help.py,sha256=
|
|
15
|
-
amapy/commands/alias_actions/alias_info.py,sha256=
|
|
16
|
-
amapy/commands/alias_actions/alias_remove.py,sha256=
|
|
17
|
-
amapy/commands/alias_actions/alias_set.py,sha256=
|
|
18
|
-
amapy/commands/asset_actions/__init__.py,sha256=
|
|
19
|
-
amapy/commands/asset_actions/add.py,sha256=
|
|
13
|
+
amapy/commands/alias_actions/alias_add.py,sha256=cR0vql-ifpRq1BewUvgpN7Jdxy4XIgNABfnEazWG_p8,853
|
|
14
|
+
amapy/commands/alias_actions/alias_help.py,sha256=RsAgu1filb3Km6UWzgmAk09967pwI_v0wodCydL4eUY,482
|
|
15
|
+
amapy/commands/alias_actions/alias_info.py,sha256=Cs0AokywfzpFT-H3glPfh-yUKjxHcgErpGXuRyTs138,351
|
|
16
|
+
amapy/commands/alias_actions/alias_remove.py,sha256=_sR5RRB0R4m132xuNI5fKVZJlxdlD2IhPdBv2LBzt-Y,351
|
|
17
|
+
amapy/commands/alias_actions/alias_set.py,sha256=9XzZlNP6Bz1lMu-w_TcsDPFqUpb0aoB-IlN8fPosRuw,685
|
|
18
|
+
amapy/commands/asset_actions/__init__.py,sha256=tZttHQysTm_SLVRIMWrXqi1akUEVrK7ZT0PXV5KCbk0,1755
|
|
19
|
+
amapy/commands/asset_actions/add.py,sha256=kTsUHDuJXuFU634ieNd9pGIPTEYMns5wZbSXo0IbJIk,2486
|
|
20
20
|
amapy/commands/asset_actions/clone.py,sha256=f-KgHIhNFxoohvWOJP7ZtUL89AGvouiUCNA5vb3pVqM,3992
|
|
21
|
-
amapy/commands/asset_actions/commit.py,sha256
|
|
21
|
+
amapy/commands/asset_actions/commit.py,sha256=-qNM2qX5vzI1aA8KnIwLyVFDuLE5UtNbHt3fM4oBJAM,756
|
|
22
22
|
amapy/commands/asset_actions/cp.py,sha256=fD8JdphWEZwVgsfrbFe1IZANel70DerkXkaZBY9qFng,2406
|
|
23
23
|
amapy/commands/asset_actions/dashboard.py,sha256=4Y71TXKF3tTEB5Cn5ZpsMHYVsQzrWwGW1bGDf1sCFto,387
|
|
24
24
|
amapy/commands/asset_actions/debug.py,sha256=p5isK75k26BcrmV5nFBCDIwGBNEr0s8tate2oK_LyCM,510
|
|
25
25
|
amapy/commands/asset_actions/delete.py,sha256=1LnHpknibp-SZjPHv0jLwJoTBlTFGpkZkydc6BLsprA,734
|
|
26
|
-
amapy/commands/asset_actions/diff.py,sha256=
|
|
27
|
-
amapy/commands/asset_actions/discard.py,sha256=
|
|
26
|
+
amapy/commands/asset_actions/diff.py,sha256=kfxo0az1WbIQa3qavnJdmh0GCdKdRTRODzv7xfPE75A,1245
|
|
27
|
+
amapy/commands/asset_actions/discard.py,sha256=5Zt-RhFwfKzBRSqEY1giPSJ1zzyMxLaBN77dpFPxxAI,1397
|
|
28
28
|
amapy/commands/asset_actions/download.py,sha256=sooiz65UKnSvIqE3glZz43WJIBQ-KTNSlzSM28K6Z08,1047
|
|
29
29
|
amapy/commands/asset_actions/fetch.py,sha256=2rQB5-9DOz74nRjSqScTEz6C3QyK_GmRTxJvw1WVgrw,2704
|
|
30
30
|
amapy/commands/asset_actions/find.py,sha256=6je3pHkv-ziA5Nq3lIW1DTQ6-uM1xIiCQDt84_Jkugw,1846
|
|
@@ -32,6 +32,7 @@ amapy/commands/asset_actions/hash.py,sha256=OratKxDQcgnjsqz3eSmaKf9v3wD8OAwgG90q
|
|
|
32
32
|
amapy/commands/asset_actions/history.py,sha256=t9TVeQl7HjPARxgWBumhPToOPpTYgi1mUBvepATo9L8,786
|
|
33
33
|
amapy/commands/asset_actions/info.py,sha256=cPKfzwLnvEc7chFhLtvmEf3nr9m_sW5joz5v8_7eliI,2928
|
|
34
34
|
amapy/commands/asset_actions/init.py,sha256=mzxD6Fohfe9eZUONXws7FGA5tnVVrksELbGePWXt6mo,834
|
|
35
|
+
amapy/commands/asset_actions/join.py,sha256=LohgVzJ7n0sU8EOGUv0GQEijPCBrpM_H77xnxEQXVjo,858
|
|
35
36
|
amapy/commands/asset_actions/list.py,sha256=EtgHZtL0qELSUKKFq85VZZU-rMOeou1bXzyPim8GyRY,1813
|
|
36
37
|
amapy/commands/asset_actions/pull.py,sha256=oNRzM51fxMlnpNICcbWrkDS9UkYYldapMKXTT5iL58U,639
|
|
37
38
|
amapy/commands/asset_actions/remote.py,sha256=9eQd3xcvQrgyG1EZP8WDqfNto2cwitqGNbIlVA4ckXg,356
|
|
@@ -42,20 +43,20 @@ amapy/commands/asset_actions/status.py,sha256=gWOp9UimIQx9Ih7DKUyLSbEPqmFOysZqW1
|
|
|
42
43
|
amapy/commands/asset_actions/switch.py,sha256=xQyvnAfPvCuw6kHvhMJqL3iBQwNFTnYW8n8vDAsvcEQ,1257
|
|
43
44
|
amapy/commands/asset_actions/tree.py,sha256=q9RLXizfIQwUVIkpPTZiSeQjCSGmXZzfSrARURjQ53k,646
|
|
44
45
|
amapy/commands/asset_actions/union.py,sha256=64EUJ6GMqUq9SY4QTLZIGT4mGKzNxmQIW3nun-WkK64,1148
|
|
45
|
-
amapy/commands/asset_actions/update.py,sha256=
|
|
46
|
+
amapy/commands/asset_actions/update.py,sha256=3Sv-LypnE_Hg6DVDsQFPOe61_kJ3mlWWUyWDvaSVRG0,1070
|
|
46
47
|
amapy/commands/asset_actions/upload.py,sha256=4XICicowRh7QDr8aKCDxk4qpEWlfFqfcgAgVFmy2G7c,579
|
|
47
48
|
amapy/commands/asset_actions/user_prompt_setting.py,sha256=WN6snpdvzx7R9Q8mvlPutXPMP11bw2rErurho7q5vDM,679
|
|
48
49
|
amapy/commands/asset_actions/versions.py,sha256=MS2oDP4IFpLndO30BVRHkevOFNGGRj0g6Au-PPo7rJ8,590
|
|
49
50
|
amapy/commands/asset_actions/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
51
|
amapy/commands/asset_actions/tests/test_add.py,sha256=Bwp3tq0Oljjxo6VQbaewJ42ebUOhhqPsxR_z1OdfaoE,637
|
|
51
|
-
amapy/commands/asset_actions/tests/test_asset_cmds.py,sha256=
|
|
52
|
+
amapy/commands/asset_actions/tests/test_asset_cmds.py,sha256=KkcGE6qgtFxnaCcd-B2Rb83zI9tSjTxd6fAYJV6pV0w,2065
|
|
52
53
|
amapy/commands/asset_actions/tests/test_info.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
54
|
amapy/commands/asset_class_actions/__init__.py,sha256=L5OgFeENSH3lyNuvzgU3TfmHs4gn8NUZV8I6jXVgfzU,852
|
|
54
55
|
amapy/commands/asset_class_actions/discard.py,sha256=xdLyj8Oo_jAK5SFtYf6SSKnrIAyMF2C8exIfZ7d4hEY,631
|
|
55
56
|
amapy/commands/asset_class_actions/fetch.py,sha256=Tb5GF3BZHvJc6VB5AUXFJgU5Cp65sOIj4LXBrGUYKYY,420
|
|
56
57
|
amapy/commands/asset_class_actions/info.py,sha256=ReH2EyXk_H_QGlUypQouTDSv2BCPOUKCeTOhFDF7Uzg,1133
|
|
57
58
|
amapy/commands/asset_class_actions/init.py,sha256=5uu4oNWiMyu26kFAXQOj-dd9oZX3haR85VCU1bS__U4,607
|
|
58
|
-
amapy/commands/asset_class_actions/list.py,sha256=
|
|
59
|
+
amapy/commands/asset_class_actions/list.py,sha256=8i31ffBj7qMglo74HFoxP8L4b3eeUbMnqXBPBvW9ZtQ,422
|
|
59
60
|
amapy/commands/asset_class_actions/rename.py,sha256=0KIUwzhhzdw2J85HgO-2iqX5TM9pcSw8kjE5ig-hDhU,835
|
|
60
61
|
amapy/commands/asset_class_actions/upload.py,sha256=LPPoXW7WOz-sTvzdl0NuuvPzmeP8byBQZzikdg9s9AQ,654
|
|
61
62
|
amapy/commands/asset_class_actions/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -79,7 +80,7 @@ amapy/commands/project_actions/project_activate.py,sha256=T93BZA5a9ZgxXapOSaB8bp
|
|
|
79
80
|
amapy/commands/project_actions/project_info.py,sha256=_fo1s9k2ClYkm-cGLpci-NOCVHcpf0JxhSS8avUIr3M,364
|
|
80
81
|
amapy/commands/project_actions/project_list.py,sha256=Eqxwdaq3y_oURPHG0QB2KLSrOmJSjfRa8N5Z0_pGVUs,353
|
|
81
82
|
amapy/commands/refs_actions/__init__.py,sha256=HO4VRIFrHgxTDi9P29fNTlzlTKvhWh_2c4WtD0xvVRw,569
|
|
82
|
-
amapy/commands/refs_actions/ref_add.py,sha256=
|
|
83
|
+
amapy/commands/refs_actions/ref_add.py,sha256=r7DGYFVf1JtgH-GDI11HJE-RsVbM2A-QzKHM8DqqH0Q,2540
|
|
83
84
|
amapy/commands/refs_actions/ref_info.py,sha256=H-y_Es7OYypkidVFEDI30X0EpIruA6XI0Kf59UX9NGM,2415
|
|
84
85
|
amapy/commands/refs_actions/ref_remove.py,sha256=GRG0xWVM7jk2H_T56AVcsYOjjT8icMTd9R6SJuECMvI,765
|
|
85
86
|
amapy/commands/store_actions/__init__.py,sha256=ps0fgsmexWLNq0TboBqNFwGPMQq0s49T32XDpg2Kq_g,709
|
|
@@ -92,23 +93,23 @@ amapy/commands/tests/test_cli_arg.py,sha256=qFSNx8CBUSeW2YGpYdHRl9x_bHnJzfBPekFL
|
|
|
92
93
|
amapy/commands/tests/test_cmd_group.py,sha256=_rJ9myOcqv1I59Pf4e98zCgCbkqg-hcgi0DZfzYp5Zs,389
|
|
93
94
|
amapy/commands/tests/test_parser.py,sha256=vv2TtG-_ogToBWQMVPkenhATrQPw-ZKbc-HMnxee83k,1642
|
|
94
95
|
amapy/python_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
95
|
-
amapy/python_api/artifact.py,sha256=
|
|
96
|
+
amapy/python_api/artifact.py,sha256=k3eRe99txlIgxRM8-Vv-E10Dpg4DUSn3QDEaq03qaxU,24435
|
|
96
97
|
amapy/python_api/artifact_ref.py,sha256=EFk7sCEEDbXGRogdS5QuGaJ-WE_yUT05pK4pWob9hGg,2418
|
|
97
98
|
amapy/python_api/asset.py,sha256=alshFDWA-tP1nM6tMdahd_MELRsw3dWd9EKQ8JtZ0NM,7852
|
|
98
99
|
amapy/python_api/auth.py,sha256=Nzbtz4vAMSBt9ww9WoEBI6aw8Oj0T9SOqENFPDmFFHM,2173
|
|
99
100
|
amapy/python_api/config.py,sha256=4myRN_kHbWBZZdtjneNwbp9PAGYGZfAyCuLqEZlotXo,1124
|
|
100
|
-
amapy/python_api/file.py,sha256
|
|
101
|
+
amapy/python_api/file.py,sha256=JvTCTEiaNn6uqc4n1ThNnmWL6ltGQfFJ2e5gXqjPPoY,570
|
|
101
102
|
amapy/python_api/inputs.py,sha256=OWg4uGY7GYYjpYdn507wsodhkIQCyNL9K9n-RbGGFzk,4334
|
|
102
103
|
amapy/python_api/klass.py,sha256=wAzRZyj-VLJ5HHfZA66AxjgDJRCOkwSHhHm2oTZ6zmU,1473
|
|
103
104
|
amapy/python_api/project.py,sha256=tCyLS_aI61BH92cklEmbtS46stusS4UDAv9qLgRMM5M,1969
|
|
104
105
|
amapy/python_api/store.py,sha256=EwlybVePq1ZevCK1PfEGiJ-Zh7PoJ4lxmceCrLRcrsg,1025
|
|
105
106
|
amapy/python_api/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
|
-
amapy/python_api/tests/test_artifact.py,sha256=
|
|
107
|
-
amapy/python_api/tests/
|
|
108
|
-
amapy/python_api/tests/test_klass.py,sha256=
|
|
109
|
-
amapy/python_api/tests/test_project.py,sha256=
|
|
110
|
-
amapy-1.0.
|
|
111
|
-
amapy-1.0.
|
|
112
|
-
amapy-1.0.
|
|
113
|
-
amapy-1.0.
|
|
114
|
-
amapy-1.0.
|
|
107
|
+
amapy/python_api/tests/test_artifact.py,sha256=eIg1dXhyj3CGEIjBFSGSNlrM1DM4MYUmfKs60APqVR0,2174
|
|
108
|
+
amapy/python_api/tests/test_file.py,sha256=sF8GOhJDWm_NukbX9srT572zv6ji2YbI3AMSlcSLDR0,922
|
|
109
|
+
amapy/python_api/tests/test_klass.py,sha256=kiEEvTOvcyPms70XGHt--KBBv3TkrlZYhBNf1btE-Eo,669
|
|
110
|
+
amapy/python_api/tests/test_project.py,sha256=DJChb8WYn-94AM9J9emUg1hCMiv_K9dRUk9f0ogykFU,1146
|
|
111
|
+
amapy-1.1.0.dev4.dist-info/METADATA,sha256=dELyY7Y37To0G5iDnBBSTK1vn_kajzKnpPT2_5unlhw,1475
|
|
112
|
+
amapy-1.1.0.dev4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
113
|
+
amapy-1.1.0.dev4.dist-info/entry_points.txt,sha256=e9MSxNAIeRDjJnFmhhWjmZml8D2iD1Naj2DZiijKsRI,60
|
|
114
|
+
amapy-1.1.0.dev4.dist-info/top_level.txt,sha256=SgpxJPkM4ifP5bkSUGbAWrh7vYBlQAkgyybD7Y2M21s,6
|
|
115
|
+
amapy-1.1.0.dev4.dist-info/RECORD,,
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from amapy.python_api.auth import Auth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def test_auth_login():
|
|
5
|
-
user = Auth().login()
|
|
6
|
-
expected = {"username": str, "email": str, "token": str, "projects": list}
|
|
7
|
-
for key in expected:
|
|
8
|
-
assert type(user.get(key)) == expected[key]
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def test_auth_login_with_token():
|
|
12
|
-
token = "your_asset_manager_token"
|
|
13
|
-
user = Auth().login(token=token)
|
|
14
|
-
expected = {"username": str, "email": str, "token": str, "projects": list}
|
|
15
|
-
for key in expected:
|
|
16
|
-
assert type(user.get(key)) == expected[key]
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def test_auth_info():
|
|
20
|
-
info = Auth().info()
|
|
21
|
-
expected = ["username", "email", "project"]
|
|
22
|
-
for key in expected:
|
|
23
|
-
assert info.get(key)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def test_auth_info_token():
|
|
27
|
-
info = Auth().info(token=True)
|
|
28
|
-
expected = ["token"]
|
|
29
|
-
for key in expected:
|
|
30
|
-
assert info.get(key)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def test_auth_info_update():
|
|
34
|
-
user = Auth().update()
|
|
35
|
-
expected = {"username": str, "email": str, "token": str, "projects": list}
|
|
36
|
-
for key in expected:
|
|
37
|
-
assert type(user.get(key)) == expected[key]
|
|
File without changes
|
|
File without changes
|