示例#1
0
 def test_with_validator(self):
     validator = ImplementationValidator(client=self.client, index=True)
     try:
         validator.main()
     except Exception:
         print_exc()
     self.assertTrue(validator.valid)
示例#2
0
    def test_as_type_with_validator(self):

        test_urls = {
            "http://example.org/v0/structures": "structures",
            "http://example.org/v0/structures/mpf_1": "structure",
            "http://example.org/v0/references": "references",
            "http://example.org/v0/references/dijkstra1968": "reference",
            "http://example.org/v0/info": "info",
            "http://example.org/v0/links": "links",
        }
        with unittest.mock.patch(
                "requests.get",
                unittest.mock.Mock(side_effect=self.client.get)):
            for url, as_type in test_urls.items():
                validator = ImplementationValidator(base_url=url,
                                                    as_type=as_type,
                                                    verbosity=5)
                try:
                    validator.main()
                except Exception:
                    print_exc()
                self.assertTrue(validator.valid)
示例#3
0
 def test_with_validator(self):
     validator = ImplementationValidator(client=CLIENT, verbosity=2)
     validator.main()
     assert validator.valid is True
示例#4
0
 def test_with_validator(self):
     validator = ImplementationValidator(client=CLIENT, index=True)
     validator.main()
     self.assertTrue(validator.valid)