示例#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())
示例#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())
示例#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)
示例#4
0
 def test_from_file_should_raise_account_error(self):
     with self.assertRaises(AccountError):
         Source.from_file(dummy_file)
示例#5
0
 def test_from_file_with_path_should_return_source(self):
     self.assertIsInstance(Source.from_file(dummy_file), Source)
 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())
 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)
 def test_from_file_with_path_should_return_source_with_data(self):
     self.assertEqual(b'compressed file', Source.from_file(dummy_file).to_buffer())
 def test_from_file_with_path_should_return_source(self):
     self.assertIsInstance(Source.from_file(dummy_file), Source)
示例#10
0
 def test_from_file_should_raise_account_error(self):
     with self.assertRaises(AccountError):
         Source.from_file(dummy_file)