class APIViewHypermediaTestCase(SimpleTestCase): def setUp(self): self.api = APIViewHypermedia() def test_attributes_functions_str_has_url(self): self.assertTrue(self.api.attributes_functions_str_has_url('/ibge/bcim/aldeias-indigenas/within/http://127.0.0.1:8001/ibge/bcim/estados/ES')) self.assertTrue(self.api.attributes_functions_str_has_url('/ibge/bcim/aldeias-indigenas/within/https://127.0.0.1:8001/ibge/bcim/estados/ES')) self.assertTrue(self.api.attributes_functions_str_has_url('/ibge/bcim/aldeias-indigenas/within/http://www.inde.gov.br/ibge/bcim/estados/ES')) self.assertTrue(self.api.attributes_functions_str_has_url('/ibge/bcim/aldeias-indigenas/within/https://www.inde.gov.br/ibge/bcim/estados/ES')) self.assertTrue(self.api.attributes_functions_str_has_url('/ibge/bcim/aldeias-indigenas/within/www.inde.gov.br/ibge/bcim/estados/ES')) self.assertFalse(self.api.attributes_functions_str_has_url('/ibge/bcim/aldeias-indigenas/within/127.0.0.1:8001/ibge/bcim/estados/ES')) def test_attributes_functions_splitted_by_url(self): arr = self.api.attributes_functions_splitted_by_url('/ibge/bcim/aldeias-indigenas/within/http://127.0.0.1:8001/ibge/bcim/estados/ES') self.assertTrue(arr[0] == '/ibge/bcim/aldeias-indigenas/within/' ) self.assertTrue(arr[1] == 'http://127.0.0.1:8001/ibge/bcim/estados/ES' )
class APIViewHypermediaTestCase(SimpleTestCase): def setUp(self): self.api = APIViewHypermedia() def test_attributes_functions_str_has_url(self): self.assertTrue( self.api.attributes_functions_str_has_url( '/ibge/bcim/aldeias-indigenas/within/http://127.0.0.1:8001/ibge/bcim/estados/ES' )) self.assertTrue( self.api.attributes_functions_str_has_url( '/ibge/bcim/aldeias-indigenas/within/https://127.0.0.1:8001/ibge/bcim/estados/ES' )) self.assertTrue( self.api.attributes_functions_str_has_url( '/ibge/bcim/aldeias-indigenas/within/http://www.inde.gov.br/ibge/bcim/estados/ES' )) self.assertTrue( self.api.attributes_functions_str_has_url( '/ibge/bcim/aldeias-indigenas/within/https://www.inde.gov.br/ibge/bcim/estados/ES' )) self.assertTrue( self.api.attributes_functions_str_has_url( '/ibge/bcim/aldeias-indigenas/within/www.inde.gov.br/ibge/bcim/estados/ES' )) self.assertFalse( self.api.attributes_functions_str_has_url( '/ibge/bcim/aldeias-indigenas/within/127.0.0.1:8001/ibge/bcim/estados/ES' )) def test_attributes_functions_splitted_by_url(self): arr = self.api.attributes_functions_splitted_by_url( '/ibge/bcim/aldeias-indigenas/within/http://127.0.0.1:8001/ibge/bcim/estados/ES' ) self.assertTrue(arr[0] == '/ibge/bcim/aldeias-indigenas/within/') self.assertTrue(arr[1] == 'http://127.0.0.1:8001/ibge/bcim/estados/ES')
def setUp(self): self.api = APIViewHypermedia()