-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Max Strange
committed
Jul 7, 2019
1 parent
4a5ce40
commit 88ee237
Showing
7 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Backend | ||
|
||
This folder contains tests for the back-end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
This module contains all the tests for the Parallel-Loop hybrid construct. | ||
""" | ||
import src | ||
import unittest | ||
|
||
class TestParalellLoop(unittest.TestCase): | ||
def test_nominal(self): | ||
""" | ||
Test the nominal use of a parallel loop. | ||
""" | ||
sqrd = src.test_function() | ||
expected = [0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100] | ||
self.assertEqual(len(sqrd), len(expected)) | ||
|
||
for i, (s, e) in enumerate(zip(sqrd, expected)): | ||
self.assertEqual(s, e, "sqrd[{}] should equal expected[{}], but {} != {}".format(i, i, s, e)) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
This is source code for the tests in this module. | ||
""" | ||
import os | ||
import sys | ||
import othersrc | ||
|
||
def _a_local_function(some_args): | ||
print("Does nothing") | ||
return None | ||
|
||
def test_function(): | ||
ls = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | ||
squares = othersrc.square(ls) | ||
return squares |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters