Example #1
0
 def test_is_valid_correct_one_alias(self):
     """
     Tests that the is_valid property correctly returns True if the Location is assigned a
     unique alias.
     """
     handle_location = Location(**{"location": self.valid_location})
     handle_location.alias = self.valid_alias
     self.assertTrue(handle_location.is_valid)
     del handle_location
Example #2
0
 def test_alias_correct_multiple_times_the_same_alias(self):
     """
     Tests that if a Location object is passed multiple times the same alias, only one is
     stored.
     """
     handle_location = Location(**{"location": self.valid_location})
     for i in range(10):
         handle_location.alias = self.valid_alias
     self.assertEqual(handle_location.alias.count(self.valid_alias), 1)
     del handle_location
Example #3
0
 def test_is_valid_correct_multiple_aliases(self):
     """
     Tests that the is_valid property correctly returns False if the Location is assigned two or
     more aliases.
     """
     handle_location = Location(**{"location": self.valid_location})
     handle_location.alias = "foo1"
     handle_location.alias = "foo2"
     self.assertFalse(handle_location.is_valid)
     del handle_location
 def test_is_valid_correct_one_alias(self):
     """
     Tests that the is_valid property correctly returns True if the Location is assigned a
     unique alias.
     """
     handle_location = Location(**{
                                     "location" : self.valid_location
                                     }
                                 )
     handle_location.alias = self.valid_alias
     self.assertTrue(handle_location.is_valid)
     del handle_location
 def test_is_valid_correct_multiple_aliases(self):
     """
     Tests that the is_valid property correctly returns False if the Location is assigned two or
     more aliases.
     """
     handle_location = Location(**{
                                     "location" : self.valid_location
                                     }
                                 )
     handle_location.alias = "foo1"
     handle_location.alias = "foo2"
     self.assertFalse(handle_location.is_valid)
     del handle_location
 def test_alias_correct_multiple_times_the_same_alias(self):
     """
     Tests that if a Location object is passed multiple times the same alias, only one is
     stored.
     """
     handle_location = Location(**{
                                     "location" : self.valid_location
                                     }
                                 )
     for i in range(10):
         handle_location.alias = self.valid_alias
     self.assertEqual(handle_location.alias.count(self.valid_alias), 1)
     del handle_location