+ with self.subTest(report_path=None),\
+ mock.patch.object(main.dbs, "connect_psql") as psql,\
+ mock.patch.object(main.dbs, "connect_redis") as redis:
+ args = main.configargparse.Namespace(**{
+ "db_host": "host",
+ "redis_host": "rhost",
+ "report_path": None,
+ })
+
+ main.parse_config(args)
+ psql.assert_called_once_with(args)
+ redis.assert_called_once_with(args)
+
+ with self.subTest(report_path=None, db=None),\
+ mock.patch.object(main.dbs, "connect_psql") as psql,\
+ mock.patch.object(main.dbs, "connect_redis") as redis:
+ args = main.configargparse.Namespace(**{
+ "db_host": None,
+ "redis_host": "rhost",
+ "report_path": None,
+ })
+
+ main.parse_config(args)
+ psql.assert_not_called()
+ redis.assert_called_once_with(args)
+
+ with self.subTest(report_path=None, redis=None),\
+ mock.patch.object(main.dbs, "connect_psql") as psql,\
+ mock.patch.object(main.dbs, "connect_redis") as redis: