示例#1
0
 def test_main(self, mock_lists, mock_temp, *mocks):
     mock_temp.return_value.__enter__.return_value.name = tempfile.gettempdir(
     )
     main()
     self.assertNotEqual(mock_lists.call_count, 0)
     self.assertEqual(mock_lists.return_value.checkout.call_count,
                      mock_lists.call_count)
     self.assertEqual(mock_lists.return_value.check.call_count,
                      mock_lists.call_count)
 def test_main_test_manifest_empty(self, *mocks: Any) -> None:
     with self.assertRaises(SystemExit):
         main()
 def test_main_test_manifest(self, mock_logging: Mock, *mocks: Any) -> None:
     main()
     mock_logging.assert_has_calls([
         call("TestManifest schema validation succeeded"),
         call("Done.")
     ])
    def test_usage(self) -> None:
        with self.assertRaises(SystemExit):
            main()

        out, _ = self.capfd.readouterr()
        self.assertTrue(out.startswith("usage:"))