Esempio n. 1
0
 def test_from_file_with_file_object_should_return_source_with_data(self):
     with open(dummy_file, 'rb') as f:
         self.assertEqual(b'compressed file',
                          Source.from_file(f).to_buffer())
Esempio n. 2
0
 def test_from_file_with_path_should_return_source_with_data(self):
     self.assertEqual(b'compressed file',
                      Source.from_file(dummy_file).to_buffer())
Esempio n. 3
0
 def test_from_file_with_file_object_should_return_source(self):
     with open(dummy_file, 'rb') as f:
         self.assertIsInstance(Source.from_file(f), Source)
Esempio n. 4
0
 def test_from_file_should_raise_account_error(self):
     with self.assertRaises(AccountError):
         Source.from_file(dummy_file)
Esempio n. 5
0
 def test_from_file_with_path_should_return_source(self):
     self.assertIsInstance(Source.from_file(dummy_file), Source)
Esempio n. 6
0
 def test_from_file_with_file_object_should_return_source_with_data(self):
     with open(dummy_file, 'rb') as f:
         self.assertEqual(b'compressed file', Source.from_file(f).to_buffer())
Esempio n. 7
0
 def test_from_file_with_file_object_should_return_source(self):
     with open(dummy_file, 'rb') as f:
         self.assertIsInstance(Source.from_file(f), Source)
Esempio n. 8
0
 def test_from_file_with_path_should_return_source_with_data(self):
     self.assertEqual(b'compressed file', Source.from_file(dummy_file).to_buffer())
Esempio n. 9
0
 def test_from_file_with_path_should_return_source(self):
     self.assertIsInstance(Source.from_file(dummy_file), Source)
Esempio n. 10
0
 def test_from_file_should_raise_account_error(self):
     with self.assertRaises(AccountError):
         Source.from_file(dummy_file)