Commit c983e06b authored by Matt Traudt's avatar Matt Traudt Committed by Matt Traudt
Browse files

Update tests with --log-level

parent b88fa16b
......@@ -38,7 +38,8 @@ def empty_dotsbws(parser):
Creates a ~/.sbws with nothing in it but a config.ini
'''
d = TemporaryDirectory()
args = parser.parse_args('-d {} -vvvv init'.format(d.name).split())
args = parser.parse_args(
'-d {} --log-level DEBUG init'.format(d.name).split())
conf = get_config(args)
sbws.core.init.main(args, conf)
return d
......
......@@ -13,7 +13,7 @@ def test_generate_no_dotsbws(tmpdir, caplog, parser):
caplog.set_level(logging.DEBUG)
dotsbws = tmpdir
args = parser.parse_args(
'-d {} -vvvv generate'.format(dotsbws).split())
'-d {} --log-level DEBUG generate'.format(dotsbws).split())
conf = get_config(args)
try:
sbws.core.generate.main(args, conf)
......@@ -27,7 +27,7 @@ def test_generate_no_dotsbws(tmpdir, caplog, parser):
def test_generate_no_datadir(empty_dotsbws, caplog, parser):
dotsbws = empty_dotsbws
args = parser.parse_args(
'-d {} -vvvv generate'.format(dotsbws.name).split())
'-d {} --log-level DEBUG generate'.format(dotsbws.name).split())
conf = get_config(args)
try:
sbws.core.generate.main(args, conf)
......@@ -42,7 +42,7 @@ def test_generate_no_datadir(empty_dotsbws, caplog, parser):
def test_generate_bad_scale_constant(empty_dotsbws_datadir, caplog, parser):
dotsbws = empty_dotsbws_datadir
args = parser.parse_args(
'-d {} -vvvv generate --scale-constant -1'
'-d {} --log-level DEBUG generate --scale-constant -1'
.format(dotsbws.name).split())
conf = get_config(args)
try:
......@@ -58,7 +58,7 @@ def test_generate_bad_scale_constant(empty_dotsbws_datadir, caplog, parser):
def test_generate_empty_datadir(empty_dotsbws_datadir, caplog, parser):
dotsbws = empty_dotsbws_datadir
args = parser.parse_args(
'-d {} -vvvv generate'.format(dotsbws.name).split())
'-d {} --log-level DEBUG generate'.format(dotsbws.name).split())
conf = get_config(args)
sbws.core.generate.main(args, conf)
assert 'No recent results' in caplog.records[-1].getMessage()
......@@ -68,7 +68,7 @@ def test_generate_single_error(dotsbws_error_result, caplog, parser):
caplog.set_level(logging.DEBUG)
dotsbws = dotsbws_error_result
args = parser.parse_args(
'-d {} -vvvv generate'.format(dotsbws.name).split())
'-d {} --log-level DEBUG generate'.format(dotsbws.name).split())
conf = get_config(args)
sbws.core.generate.main(args, conf)
dd = conf['paths']['datadir']
......@@ -85,7 +85,7 @@ def test_generate_single_success_noscale(dotsbws_success_result, caplog,
parser, capfd):
dotsbws = dotsbws_success_result
args = parser.parse_args(
'-d {} -vvvv generate'.format(dotsbws.name).split())
'-d {} --log-level DEBUG generate'.format(dotsbws.name).split())
conf = get_config(args)
sbws.core.generate.main(args, conf)
dd = conf['paths']['datadir']
......@@ -116,7 +116,8 @@ def test_generate_single_success_scale(dotsbws_success_result, parser,
capfd):
dotsbws = dotsbws_success_result
args = parser.parse_args(
'-d {} -vvvv generate --scale'.format(dotsbws.name).split())
'-d {} --log-level DEBUG generate --scale'.format(dotsbws.name)
.split())
conf = get_config(args)
sbws.core.generate.main(args, conf)
dd = conf['paths']['datadir']
......@@ -146,7 +147,7 @@ def test_generate_single_relay_success_noscale(
dotsbws_success_result_one_relay, parser, capfd):
dotsbws = dotsbws_success_result_one_relay
args = parser.parse_args(
'-d {} -vvvv generate'.format(dotsbws.name).split())
'-d {} --log-level DEBUG generate'.format(dotsbws.name).split())
conf = get_config(args)
sbws.core.generate.main(args, conf)
dd = conf['paths']['datadir']
......@@ -178,7 +179,8 @@ def test_generate_single_relay_success_scale(
dotsbws_success_result_one_relay, parser, capfd):
dotsbws = dotsbws_success_result_one_relay
args = parser.parse_args(
'-d {} -vvvv generate --scale'.format(dotsbws.name).split())
'-d {} --log-level DEBUG generate --scale'.format(dotsbws.name)
.split())
conf = get_config(args)
sbws.core.generate.main(args, conf)
dd = conf['paths']['datadir']
......@@ -208,7 +210,7 @@ def test_generate_two_relays_success_noscale(
dotsbws_success_result_two_relays, parser, capfd):
dotsbws = dotsbws_success_result_two_relays
args = parser.parse_args(
'-d {} -vvvv generate'.format(dotsbws.name).split())
'-d {} --log-level DEBUG generate'.format(dotsbws.name).split())
conf = get_config(args)
sbws.core.generate.main(args, conf)
dd = conf['paths']['datadir']
......
......@@ -14,7 +14,7 @@ import logging
def init_directory(dname):
p = create_parser()
args = p.parse_args('-d {} -vvvv init'.format(dname).split())
args = p.parse_args('-d {} --log-level DEBUG init'.format(dname).split())
conf = get_config(args)
sbws.core.init.main(args, conf)
......@@ -60,7 +60,7 @@ def test_stats_uninitted(tmpdir, caplog):
An un-initialized .sbws directory should fail hard and exit immediately
'''
p = create_parser()
args = p.parse_args('-d {} -vvvv stats'.format(tmpdir).split())
args = p.parse_args('-d {} --log-level DEBUG stats'.format(tmpdir).split())
conf = get_config(args)
try:
sbws.core.stats.main(args, conf)
......@@ -79,7 +79,7 @@ def test_stats_initted(tmpdir, caplog):
'''
init_directory(tmpdir)
p = create_parser()
args = p.parse_args('-d {} -vvvv stats'.format(tmpdir).split())
args = p.parse_args('-d {} --log-level DEBUG stats'.format(tmpdir).split())
conf = get_config(args)
try:
sbws.core.stats.main(args, conf)
......@@ -99,7 +99,7 @@ def test_stats_stale_result(tmpdir, caplog):
init_directory(tmpdir)
add_single_stale_result(tmpdir)
p = create_parser()
args = p.parse_args('-d {} -vvvv stats'.format(tmpdir).split())
args = p.parse_args('-d {} --log-level DEBUG stats'.format(tmpdir).split())
conf = get_config(args)
sbws.core.stats.main(args, conf)
assert 'No fresh results' == caplog.records[-1].getMessage()
......@@ -115,7 +115,7 @@ def test_stats_fresh_result(tmpdir, capsys, caplog):
add_single_fresh_result(tmpdir)
p = create_parser()
args = p.parse_args(
'-d {} -vvvv stats --error-types'.format(tmpdir).split())
'-d {} --log-level DEBUG stats --error-types'.format(tmpdir).split())
conf = get_config(args)
sbws.core.stats.main(args, conf)
captured = capsys.readouterr()
......@@ -147,7 +147,7 @@ def test_stats_fresh_results(tmpdir, capsys, caplog):
add_two_fresh_results(tmpdir)
p = create_parser()
args = p.parse_args(
'-d {} -vvvv stats --error-types'.format(tmpdir).split())
'-d {} --log-level DEBUG stats --error-types'.format(tmpdir).split())
conf = get_config(args)
sbws.core.stats.main(args, conf)
needed_output_lines = [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment