コード例 #1
0
        def test_get_template_not_found(
            self, atom: Atom, collection: Collection, template: Template
        ):
            with pytest.raises(RequestFailedError):
                atom.get_template("invalid collection id", "0")

            with pytest.raises(RequestFailedError):
                atom.get_template(collection.get_id(), "0")
コード例 #2
0
        def test_get_template(
            self, atom: Atom, collection: Collection, template: Template
        ):
            result_template_class = atom.get_template(collection, template.get_id())
            assert isinstance(result_template_class, Template)
            assert result_template_class == template

            result_template_str = atom.get_template(
                collection.get_id(), template.get_id()
            )
            assert isinstance(result_template_str, Template)
            assert result_template_str == template

            assert result_template_class == result_template_str == template
コード例 #3
0
        def test_get_template_param_check(self, atom: Atom):
            with pytest.raises(AssertionError):
                atom.get_template(123, 123)

            with pytest.raises(AtomicIDError):
                atom.get_template("123", "not numeric")