+ with self.subTest(quiet=True):
+ with mock.patch("main.parse_args") as parse_args,\
+ mock.patch("main.parse_config") as parse_config,\
+ mock.patch("main.fetch_markets") as fetch_markets,\
+ mock.patch("store.Portfolio.report") as report,\
+ mock.patch("main.process") as process:
+
+ args_mock = mock.Mock()
+ args_mock.parallel = False
+ args_mock.quiet = True
+ args_mock.user = "user"
+ parse_args.return_value = args_mock
+
+ fetch_markets.return_value = [
+ [3, "config1", 1, "options"],
+ [1, "config2", 2, "options"]
+ ]
+
+ main.main(["Foo", "Bar"])
+
+ report.set_verbose.assert_called_once_with(False)
+
+ with self.subTest(quiet=False):
+ with mock.patch("main.parse_args") as parse_args,\
+ mock.patch("main.parse_config") as parse_config,\
+ mock.patch("main.fetch_markets") as fetch_markets,\
+ mock.patch("store.Portfolio.report") as report,\
+ mock.patch("main.process") as process:
+
+ args_mock = mock.Mock()
+ args_mock.parallel = False
+ args_mock.quiet = False
+ args_mock.user = "user"
+ parse_args.return_value = args_mock
+
+ fetch_markets.return_value = [
+ [3, "config1", 1, "options"],
+ [1, "config2", 2, "options"]
+ ]
+
+ main.main(["Foo", "Bar"])
+
+ report.set_verbose.assert_called_once_with(True)
+
+