def test_LocationFactory_fromString(self): from niprov.locationfactory import LocationFactory with patch('niprov.locationfactory.Location') as Location: factory = LocationFactory() out = factory.fromString('abc') Location.assert_called_with('abc') self.assertEqual(Location(), out)
def test_LocationFactory_completeString(self): from niprov.locationfactory import LocationFactory with patch('niprov.locationfactory.Location') as Location: factory = LocationFactory() factory.fromString = Mock() outstr = factory.completeString('/j/k/l') factory.fromString.assert_called_with('/j/k/l') self.assertEqual(str(factory.fromString()), outstr)