forked from LiberAI/NSpM
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solving conflicts, merging v2 into master.
- Loading branch information
Showing
5 changed files
with
104 additions
and
5 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
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 |
---|---|---|
|
@@ -23,3 +23,4 @@ tensorflow==2.4.0 | |
termcolor==1.1.0 | ||
tqdm==4.56.0 | ||
Werkzeug==1.0.1 | ||
airML==0.0.3 |
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,34 @@ | ||
import subprocess | ||
import unittest | ||
|
||
|
||
class TestAirML(unittest.TestCase): | ||
def test_airml_input_args_with_valid_kn(self): | ||
process = subprocess.Popen( | ||
['python3', 'interpreter.py', "--airml", "http://nspm.org/art", "--output", "test", "--inputstr", | ||
'"yuncken freeman has architected in how many cities?"'], stdout=subprocess.PIPE) | ||
output, err = process.communicate() | ||
output = output.decode("utf-8") | ||
self.assertTrue("http://nspm.org/art KB installed." in output) | ||
self.assertTrue("Predicted translation:" in output) | ||
|
||
def test_airml_input_args_with_invalid_kn(self): | ||
process = subprocess.Popen( | ||
['python3', 'interpreter.py', "--airml", "http://nspm.org/arts", "--output", "test", "--inputstr", | ||
'"yuncken freeman has architected in how many cities?"'], stdout=subprocess.PIPE) | ||
output, err = process.communicate() | ||
output = output.decode("utf-8") | ||
self.assertTrue("Predicted translation:" not in output) | ||
|
||
def test_airml_without_input_arg(self): | ||
process = subprocess.Popen( | ||
['python3', 'interpreter.py', "--output", "test", "--inputstr", | ||
'"yuncken freeman has architected in how many cities?"'], stdout=subprocess.PIPE) | ||
output, err = process.communicate() | ||
output = output.decode("utf-8") | ||
self.assertTrue("--input or --airml argument should be provided to load the model." in output) | ||
self.assertTrue("Predicted translation:" not in output) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |