Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Commit

Permalink
Add initial test, fix update travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvinas01 committed Oct 12, 2017
1 parent ad1966d commit 50d61b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ python:
- "3.5"
install:
- pip install -r requirements.txt

# See https://gist.github.com/dan-blanchard/7045057
- pip install --upgrade pip setuptools wheel
- pip install --only-binary=numpy,scipy numpy scipy
script:
- python -m unittest discover --pattern=*_test.py
- python -m unittest discover tests
notifications:
email:
on_success: never
Expand Down
10 changes: 0 additions & 10 deletions tests/example_test.py

This file was deleted.

27 changes: 27 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import unittest
import utils

from tempfile import mkdtemp
from shutil import rmtree
from os import path


class TestUtils(unittest.TestCase):
def setUp(self):
self.test_dir = mkdtemp()

def tearDown(self):
rmtree(self.test_dir)

def test_read_text_file(self):
file_path = path.join(self.test_dir, 'tmp.txt')
content = 'test'

with open(file_path, 'w') as f:
f.write(content)

self.assertEqual(utils.read_text_file(file_path), content)


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

0 comments on commit 50d61b0

Please sign in to comment.