Example #1
0
        def test_get_assets_schema(self, atom: Atom, schema: Schema):
            result_class = atom.get_assets(schema=schema, limit=5)
            assert isinstance(result_class, list)
            assert len(result_class) > 0
            assert isinstance(result_class[0], Asset)

            result_str = atom.get_assets(schema=schema.get_id(), limit=5)
            assert isinstance(result_str, list)
            assert len(result_str) > 0
            assert isinstance(result_str[0], Asset)

            assert result_class == result_str
Example #2
0
        def test_get_assets_collection(self, atom: Atom, collection: Collection):
            result_class = atom.get_assets(collection=collection, limit=5)
            assert isinstance(result_class, list)
            assert len(result_class) > 0
            assert isinstance(result_class[0], Asset)

            result_str = atom.get_assets(collection=collection.get_id(), limit=5)
            assert isinstance(result_str, list)
            assert len(result_str) > 0
            assert isinstance(result_str[0], Asset)

            assert result_class == result_str
Example #3
0
        def test_get_assets_template(self, atom: Atom, template: Template):
            result_class = atom.get_assets(template=template, limit=5)
            assert isinstance(result_class, list)
            assert len(result_class) > 0
            assert isinstance(result_class[0], Asset)

            result_str = atom.get_assets(template=template.get_id(), limit=5)
            assert isinstance(result_str, list)
            assert len(result_str) > 0
            assert isinstance(result_str[0], Asset)

            result_int = atom.get_assets(template=int(template.get_id()), limit=5)
            assert isinstance(result_int, list)
            assert len(result_int) > 0
            assert isinstance(result_int[0], Asset)

            assert result_class == result_str == result_int
Example #4
0
 def test_get_assets_param_check(self, atom: Atom):
     with pytest.raises(NoFiltersError):
         atom.get_assets()
Example #5
0
 def test_get_assets_owner(self, atom: Atom):
     result = atom.get_assets(owner=account, limit=5)
     assert isinstance(result, list)
     assert len(result) > 0
     assert isinstance(result[0], Asset)
Example #6
0
 def test_get_assets_invalid_request(self, atom: Atom):
     with pytest.raises(RequestFailedError):
         atom.get_assets(template="failed")
Example #7
0
 def test_get_assets_not_found(self, atom: Atom):
     result = atom.get_assets(owner="/")
     assert isinstance(result, list)
     assert len(result) == 0