- Timestamp:
- 8 Nov 2011, 14:13:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/ulif-extimgstore/src/waeup/sirp/tests/test_imagestorage.py
r7002 r7032 310 310 self.assertEqual(contents, 'Hi there!') 311 311 312 class NameChooserTests(unittest.TestCase): 312 class FileStoreNameChooserTests(FunctionalTestCase): 313 314 layer = FunctionalLayer 313 315 314 316 def test_iface(self): 317 # we provide the interfaces we promise to do 315 318 obj = FileStoreNameChooser(None) 316 319 verifyClass(IFileStoreNameChooser, FileStoreNameChooser) 317 320 verifyObject(IFileStoreNameChooser, obj) 321 return 322 323 def test_accessible_as_adapter(self): 324 # we can get a file name chooser via adapter 325 chooser = IFileStoreNameChooser(object()) 326 self.assertTrue( 327 isinstance(chooser, FileStoreNameChooser)) 328 return 329 330 def test_check_name(self): 331 # default file name choosers accept any string 332 chooser = FileStoreNameChooser(object()) 333 self.assertEqual(chooser.checkName('Hi there!'), True) 334 self.assertEqual(chooser.checkName(None), False) 335 return 336 337 def test_choose_name(self): 338 # we get a simple string if we do not pass in a valid string 339 chooser = FileStoreNameChooser(object()) 340 self.assertEqual(chooser.chooseName('myname'), 'myname') 341 self.assertEqual(chooser.chooseName(None), u'unknown_file') 318 342 return 319 343
Note: See TracChangeset for help on using the changeset viewer.