Skip to content

Commit

Permalink
New utils tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Meyer committed Feb 27, 2018
1 parent 41ebf1f commit a5ec11e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions integration_tests/utils_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import os
import logging

import pandas as pd

from integration_tests.bchain.getdata_test import temp_dir

Expand All @@ -21,3 +24,10 @@ def test_clean_up(temp_dir):
assert filenames[1].endswith('test_4.txt')


def test_logging_config(temp_dir):
assert len(os.listdir(temp_dir)) == 0

tfut.configure_logging(temp_dir, pd.datetime.utcnow())
logging.getLogger().info('foobar')

assert len(os.listdir(temp_dir)) == 1
8 changes: 8 additions & 0 deletions tests/utils_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from trufflepig.utils import progressbar


def test_progressbar():
result = []
for irun in range(100):
result.append(progressbar(irun, 100, percentage_step=1))
assert all(result)

0 comments on commit a5ec11e

Please sign in to comment.