Skip to content

travis #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ language: python
python: 3.6

# Install ruby to get gem command
#before_install:
# - sudo apt-add-repository -y ppa:brightbox/ruby-ng
# - sudo apt-get -y update
# - sudo apt-get -y install ruby-full

before_install:
- cd Algorithm_tests/sorting_tests
- sudo apt-add-repository -y ppa:brightbox/ruby-ng
- sudo apt-get -y update
- sudo apt-get -y install ruby-full

#before_install:
# - cd Algorithm_tests/sorting_tests

# Install awesome_bot for README.md broken link checking
before_script:
- gem install awesome_bot

script:
# - awesome_bot README.md --allow-dupe --allow-redirect
- python test_sorting.py
- awesome_bot README.md --allow-dupe --allow-redirect
- python Algorithm_tests/sorting_tests/test_sorting.py
- python Algorithm_tests/graphtheory_tests/bellman_ford_test.py
8 changes: 6 additions & 2 deletions Algorithm_tests/graphtheory_tests/bellman_ford_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
import unittest

# For importing from different folders
sys.path.append('../../Algorithms/graphtheory/bellman-ford')
# OBS: This is supposed to be done with automated testing, hence relative to folder we want to import from
sys.path.append('Algorithms/graphtheory/bellman-ford')

# If run from local:
#sys.path.append('../../Algorithms/graphtheory/bellman-ford')

from bellman_ford import bellman_ford, make_graph

class test_sorting(unittest.TestCase):

def test_loadgraph(self):
correct_graph = {1: {2: 5, 3: 10}, 2: {4: -5}, 3: {4: 15}}
graph = make_graph('test_graph.txt')
graph = make_graph('Algorithm_tests/graphtheory_tests/test_graph.txt')

self.assertEqual(graph, correct_graph)

Expand Down
6 changes: 5 additions & 1 deletion Algorithm_tests/sorting_tests/test_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import unittest

# For importing from different folders
sys.path.append('../../Algorithms/sorting')
# OBS: This is supposed to be done with automated testing, hence relative to folder we want to import from
sys.path.append('Algorithms/sorting')

# If run from local:
# sys.path.append('../../Algorithms/sorting')

from bubblesort import bubblesort
from insertionsort import insertionsort
Expand Down
Binary file not shown.