def test_tree(self): test_map = ('ex1.nl', 'o.1.example.eu', 'a1a.b2b.c3c.example.com') res_map = (['ex1.nl'], ['o.1.example.eu', '1.example.eu', 'example.eu'], [ 'a1a.b2b.c3c.example.com', 'b2b.c3c.example.com', 'c3c.example.com', 'example.com' ]) for domain, result in zip(test_map, res_map): self.assertEqual(_tree(domain), result)
def test_tree(self): test_map = ( "ex1.nl", "o.1.example.eu", "a1a.b2b.c3c.example.com", "c3c.example.co.uk", "c3c.example.mil.ng", ) res_map = ( ["ex1.nl"], ["o.1.example.eu", "1.example.eu", "example.eu"], [ "a1a.b2b.c3c.example.com", "b2b.c3c.example.com", "c3c.example.com", "example.com", ], ["c3c.example.co.uk", "example.co.uk"], ["c3c.example.mil.ng", "example.mil.ng"], ) for domain, result in zip(test_map, res_map): self.assertEqual(_tree(domain), result)