コード例 #1
0
ファイル: test_utils.py プロジェクト: Bbouley/conda
 def test_returns_false_if_not_all_files_are_opened(self):
     with create_mock_can_open() as can_open:
         can_open.return_value = False
         self.assertFalse(utils.can_open_all([
             "/some/path/a",
             "/some/path/b",
         ]))
コード例 #2
0
 def test_returns_false_if_not_all_files_are_opened(self):
     with create_mock_can_open() as can_open:
         can_open.return_value = False
         self.assertFalse(utils.can_open_all([
             "/some/path/a",
             "/some/path/b",
         ]))
コード例 #3
0
 def test_returns_true_if_all_files_are_openable(self):
     with create_mock_can_open():
         self.assertTrue(
             utils.can_open_all([
                 "/some/path/a",
                 "/some/path/b",
             ]))
コード例 #4
0
ファイル: test_utils.py プロジェクト: Bbouley/conda
 def test_only_call_can_open_as_many_times_as_needed(self):
     with create_mock_can_open() as can_open:
         can_open.side_effect = [True, False, True]
         self.assertFalse(utils.can_open_all([
             "/can/open",
             "/cannot/open",
             "/can/open",
         ]))
     self.assertEqual(can_open.call_count, 2)
コード例 #5
0
 def test_only_call_can_open_as_many_times_as_needed(self):
     with create_mock_can_open() as can_open:
         can_open.side_effect = [True, False, True]
         self.assertFalse(utils.can_open_all([
             "/can/open",
             "/cannot/open",
             "/can/open",
         ]))
     self.assertEqual(can_open.call_count, 2)
コード例 #6
0
ファイル: test_utils.py プロジェクト: yinglang/conda
 def test_returns_true_if_all_files_are_openable(self):
     with create_mock_can_open():
         self.assertTrue(utils.can_open_all(["/some/path/a", "/some/path/b"]))