예제 #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)
예제 #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())
예제 #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)
예제 #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())
예제 #9
0
 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)