Exemplo n.º 1
0
 def testExists(self):
     fs = DummyFS(self.example_files)
     self.assertTrue(fs.exists(self.first_file_name))
     self.assertFalse(fs.exists("nonexistent"))
Exemplo n.º 2
0
 def testListFiles(self):
     fs = DummyFS(self.example_files)
     all_files = set(self.example_files)
     self.assertEquals(all_files, fs.list_objects())
Exemplo n.º 3
0
 def testGetFile(self):
     fs = DummyFS(self.example_files)
     self.assertIs(fs.get_object(self.first_file_name), self.first_file)
     self.assertRaises(KeyError, lambda: fs.get_object("nonexistent"))
Exemplo n.º 4
0
 def testListFiles(self):
     fs = DummyFS(self.example_files)
     all_files = set(self.example_files)
     self.assertEquals(all_files, fs.list_objects())
Exemplo n.º 5
0
 def testExists(self):
     fs = DummyFS(self.example_files)
     self.assertTrue(fs.exists(self.first_file_name))
     self.assertFalse(fs.exists("nonexistent"))
Exemplo n.º 6
0
 def testGetFile(self):
     fs = DummyFS(self.example_files)
     self.assertIs(fs.get_object(self.first_file_name), self.first_file)
     self.assertRaises(KeyError, lambda: fs.get_object("nonexistent"))
Exemplo n.º 7
0
 def testInit(self):
     DummyFS([])