From 8dddb46689901b93a3e6019a50dbcb5f0e144140 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Fri, 9 Dec 2022 11:40:45 -0500 Subject: [PATCH] fix various test problems --- t/test_args.py | 18 +++++++++--------- t/test_dispatch.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/t/test_args.py b/t/test_args.py index 91896ec..b88dd1e 100644 --- a/t/test_args.py +++ b/t/test_args.py @@ -2,30 +2,30 @@ # coding: utf-8 import pytest -from ldogger.args import get_arg_parser +from ldogger.args import get_ldogger_arg_parser def test_parse_args_and_process_first_pass(): - p = get_arg_parser() + p = get_ldogger_arg_parser() a0 = p.parse_args(["--meta", "test1=1"]) a1 = p.process("--meta", "test1=1") - assert hasattr(a0, "meta") and a0.meta == {"test1": 1} - assert hasattr(a1, "meta") and a1.meta == {"test1": 1} + assert hasattr(a0, "meta") and a0.meta == {"test1": "1"} + assert hasattr(a1, "meta") and a1.meta == {"test1": "1"} def test_process(): - p = get_arg_parser() + p = get_ldogger_arg_parser() a0 = p.process("--meta test1=1 --meta test2=2") - assert a0.meta == {"test1": 1, "test2": 2} + assert a0.meta == {"test1": "1", "test2": "2"} a1 = a0.reprocess("--meta test3=3") - assert a1.meta == {"test1": 1, "test2": 2, "test3": 3} + assert a1.meta == {"test1": "1", "test2": "2", "test3": "3"} a2 = a0.reprocess("--meta test4=4") - assert a2.meta == {"test1": 1, "test2": 2, "test4": 4} + assert a2.meta == {"test1": "1", "test2": "2", "test4": "4"} d0 = a0.as_dict() d1 = a1.as_dict() @@ -35,7 +35,7 @@ def test_process(): def test_stupid_reprocess_args(): - p = get_arg_parser() + p = get_ldogger_arg_parser() a0 = p.process() with pytest.raises(SystemExit) as exc: a0.reprocess("--help") diff --git a/t/test_dispatch.py b/t/test_dispatch.py index 942c293..4bc5020 100644 --- a/t/test_dispatch.py +++ b/t/test_dispatch.py @@ -3,7 +3,7 @@ import os -import logdna.dispatch as d +import ldogger.dispatch as d def test_headers(): @@ -18,4 +18,4 @@ def test_url(): assert url == "https://logs.logdna.com/logs/ingest?hostname=white-rabit&now=94712411" url = d.gen_url(hostname="white-rabit", tags=["supz", "mang"], now=94712417) - assert url == "https://logs.logdna.com/logs/ingest?hostname=white-rabit&tags=supz,mang&now=94712417" + assert url == "https://logs.logdna.com/logs/ingest?hostname=white-rabit&tags=mang,supz&now=94712417"