def test_locations_correct(self): """ Tests that if a ServerName object properly returns the stored location(s). """ location = "/var/www/foo/" handle_servername = ServerName(**{ "domain": self.valid_domain, }) handle_location = Location(**{"location": location}) handle_servername.locations = handle_location self.assertEqual(handle_servername.locations[location].location, location) del handle_location del handle_servername
def test_locations_correct_multiple_times_the_same_location(self): """ Tests that if a ServerName object is passed multiple times the same Location, only one is added. """ location = "/var/www/foo/" handle_servername = ServerName(**{ "domain": self.valid_domain, }) for i in range(10): handle_location = Location(**{"location": location}) handle_servername.locations = handle_location self.assertEqual(len(handle_servername.locations), 1) self.assertEqual(handle_servername.locations[location].location, location) del handle_servername
def test_locations_correct(self): """ Tests that if a ServerName object properly returns the stored location(s). """ location = "/var/www/foo/" handle_servername = ServerName(**{ "domain" : self.valid_domain, } ) handle_location = Location(**{ "location" : location } ) handle_servername.locations = handle_location self.assertEqual(handle_servername.locations[location].location, location) del handle_location del handle_servername
def test_locations_correct_multiple_times_the_same_location(self): """ Tests that if a ServerName object is passed multiple times the same Location, only one is added. """ location = "/var/www/foo/" handle_servername = ServerName(**{ "domain" : self.valid_domain, } ) for i in range(10): handle_location = Location(**{ "location" : location } ) handle_servername.locations = handle_location self.assertEqual(len(handle_servername.locations), 1) self.assertEqual(handle_servername.locations[location].location, location) del handle_servername