- db_config, redis_config = main.parse_config(args)
- self.assertEqual({ "host": "host", "port": "port", "user":
- "user", "password": "password", "database": "database"
- }, db_config)
- self.assertEqual({ "host": "rhost", "port": "rport", "db":
- "rdb"}, redis_config)
+ 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,
+ })