Skip to content

Commit

Permalink
more tests improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
TabulateJarl8 committed Aug 16, 2021
1 parent 53cc389 commit d59599a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# test output
/output.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
20 changes: 11 additions & 9 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
import subprocess

try:
import ti842py
import ti842py
except ImportError as exc:
raise ImportError('ti842py is not installed. Please install the local version by running `python3 setup.py sdist` followed by `pip3 install dist/* --force-reinstall` in the root directory of the repository') from exc
raise ImportError('ti842py is not installed. Please install the local version by running `python3 setup.py sdist` followed by `pip3 install dist/* --force-reinstall` in the root directory of the repository') from exc

print(f'ti842py version {ti842py.__version__}')

parent_directory = pathlib.Path(__file__).parents[1].resolve()

class MainTestCase(unittest.TestCase):
def test_traspile(self):
ti842py.transpile(str(parent_directory / 'program.txt'), str(parent_directory / 'output.py'))
def test_traspile(self):
ti842py.transpile(str(parent_directory / 'program.txt'), str(parent_directory / 'output.py'))

def test_command_transpile(self):
child = subprocess.Popen(['ti842py', str(parent_directory / 'program.txt'), '-o', str(parent_directory / 'output.py')])
child.communicate()
self.assertEqual(child.returncode, 0, 'Must exit with code 0')
def test_command_transpile(self):
child = subprocess.Popen(['ti842py', str(parent_directory / 'program.txt'), '-o', str(parent_directory / 'output.py')])
child.communicate()
self.assertEqual(child.returncode, 0, 'Must exit with code 0')


if __name__ == '__main__':
unittest.main()
unittest.main()

0 comments on commit d59599a

Please sign in to comment.