Skip to content

Commit

Permalink
tests: fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
breakthewall committed Oct 13, 2021
1 parent d39aac0 commit 8c842d7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/test_input-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_BadInputFormatCSV_1(self):
self.assertRaises(
KeyError,
parse_rules,
rules_file='data/rules.csv',
rules_file=self.rules_file,
input_format='tsv',
diameters=diam,
outfile=outfile.name
Expand All @@ -55,7 +55,7 @@ def test_BadInputFormatCSV_2(self):
outfile = NamedTemporaryFile(delete=True)
self.assertRaises(ValueError,
parse_rules,
rules_file='data/rules.csv',
rules_file=self.rules_file,
input_format='other',
diameters=diam,
outfile=outfile.name)
Expand Down
21 changes: 17 additions & 4 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Generic for test process
from unittest import TestCase

from os import path as os_path
# Specific for tool
from rrparser import __path__ as pkg_path

Expand All @@ -18,7 +18,20 @@ class Test_RR(TestCase):


diameters = ['2', '4', '6', '8', '10', '12', '14', '16']
rules_file = 'data/rules.csv'
ref_d2_csv = 'data/out_d2.csv'
ref_d2_tsv = 'data/out_d2.tsv'
data = os_path.join(
os_path.dirname(os_path.realpath(__file__)),
'data'
)
rules_file = os_path.join(
data,
'rules.csv'
)
ref_d2_csv = os_path.join(
data,
'out_d2.csv'
)
ref_d2_tsv = os_path.join(
data,
'out_d2.tsv'
)
pkg_path = pkg_path
4 changes: 1 addition & 3 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
from rrparser import parse_rules

# Specific for tests themselves
from os import stat
from itertools import combinations
from random import sample, seed
from io import open as io_open
from tempfile import NamedTemporaryFile
from tarfile import open as tf_open


# Cette classe est un groupe de tests. Son nom DOIT commencer
Expand All @@ -44,7 +42,7 @@ def test_SmallRulesFile_OneDiameter_SpecifyOutfile(self):
diam = '2'
outfile = NamedTemporaryFile(delete=False)
parse_rules(
rules_file = 'data/rules.csv',
rules_file = self.rules_file,
outfile = outfile.name,
diameters = diam,
output_format = format
Expand Down

0 comments on commit 8c842d7

Please # to comment.