Skip to content

Commit

Permalink
Move sample files under tests/data to tests/sample
Browse files Browse the repository at this point in the history
Resolves #23
  • Loading branch information
suminb committed Mar 14, 2018
1 parent db9358a commit fbb1cba
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test___main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_insert_test_data_all():

def test_import_8percent(account_checking, account_8p, asset_krw):
runner = CliRunner()
result = runner.invoke(import_8percent, ['tests/data/8percent-829.html'],
result = runner.invoke(import_8percent, ['tests/samples/8percent-829.html'],
catch_exceptions=False)
assert result.exit_code == 0

Expand Down Expand Up @@ -64,7 +64,7 @@ def test_import_stock_records(asset_krw, account_stock, account_checking):
pass

runner = CliRunner()
result = runner.invoke(import_stock_records, ['tests/data/stocks.csv'],
result = runner.invoke(import_stock_records, ['tests/samples/stocks.csv'],
catch_exceptions=False)
assert result.exit_code == 0

Expand Down
6 changes: 3 additions & 3 deletions tests/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def test_8percent_fetch_data():
assert resp.status_code in [200, 404]

if resp.status_code == 200:
sample_file = os.path.join(PROJECT_PATH, 'tests', 'data',
sample_file = os.path.join(PROJECT_PATH, 'tests', 'samples',
'8percent-829.html')
with open(sample_file, 'w') as fout:
fout.write(resp.text)


def test_8percent_parse_data():
sample_file = os.path.join(PROJECT_PATH, 'tests', 'data',
sample_file = os.path.join(PROJECT_PATH, 'tests', 'samples',
'8percent-829.html')
with open(sample_file) as fin:
raw = fin.read()
Expand Down Expand Up @@ -194,7 +194,7 @@ def test_dart_fetch_data_with_invalid_code():
def test_miraeasset_transactions(param):
provider = Miraeasset()
filename = os.path.join(
BASE_PATH, 'data', 'miraeasset_{}.csv'.format(param))
BASE_PATH, 'samples', 'miraeasset_{}.csv'.format(param))
with open(filename) as fin:
if param == 'local':
records = provider.parse_local_transactions(fin)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_parse_stock_code(code, result):


def test_parse_stock_records():
sample_file = 'tests/data/stocks.csv'
sample_file = 'tests/samples/stocks.csv'
flag = True
expected_keys = ('date', 'sequence', 'category1', 'category2', 'code',
'name', 'quantity', 'unit_price', 'subtotal', 'interest',
Expand Down

0 comments on commit fbb1cba

Please sign in to comment.