Beispiel #1
0
 def test__next_id_suffix_increments(self):
     generate_ids._gen_file_id_suffix = "foo-"
     generate_ids._gen_file_id_serial = 1
     try:
         self.assertEqual("foo-2", generate_ids._next_id_suffix())
         self.assertEqual("foo-3", generate_ids._next_id_suffix())
         self.assertEqual("foo-4", generate_ids._next_id_suffix())
         self.assertEqual("foo-5", generate_ids._next_id_suffix())
         self.assertEqual("foo-6", generate_ids._next_id_suffix())
         self.assertEqual("foo-7", generate_ids._next_id_suffix())
         self.assertEqual("foo-8", generate_ids._next_id_suffix())
         self.assertEqual("foo-9", generate_ids._next_id_suffix())
         self.assertEqual("foo-10", generate_ids._next_id_suffix())
     finally:
         # Reset so that all future ids generated in the test suite
         # don't end in 'foo-XXX'
         generate_ids._gen_file_id_suffix = None
         generate_ids._gen_file_id_serial = 0
 def test__next_id_suffix_increments(self):
     generate_ids._gen_file_id_suffix = "foo-"
     generate_ids._gen_file_id_serial = 1
     try:
         self.assertEqual("foo-2", generate_ids._next_id_suffix())
         self.assertEqual("foo-3", generate_ids._next_id_suffix())
         self.assertEqual("foo-4", generate_ids._next_id_suffix())
         self.assertEqual("foo-5", generate_ids._next_id_suffix())
         self.assertEqual("foo-6", generate_ids._next_id_suffix())
         self.assertEqual("foo-7", generate_ids._next_id_suffix())
         self.assertEqual("foo-8", generate_ids._next_id_suffix())
         self.assertEqual("foo-9", generate_ids._next_id_suffix())
         self.assertEqual("foo-10", generate_ids._next_id_suffix())
     finally:
         # Reset so that all future ids generated in the test suite
         # don't end in 'foo-XXX'
         generate_ids._gen_file_id_suffix = None
         generate_ids._gen_file_id_serial = 0
Beispiel #3
0
 def test__next_id_suffix_sets_suffix(self):
     generate_ids._gen_file_id_suffix = None
     generate_ids._next_id_suffix()
     self.assertNotEqual(None, generate_ids._gen_file_id_suffix)
 def test__next_id_suffix_sets_suffix(self):
     generate_ids._gen_file_id_suffix = None
     generate_ids._next_id_suffix()
     self.assertNotEqual(None, generate_ids._gen_file_id_suffix)