Skip to content

Commit 420e8c0

Browse files
author
Anh-Duy Le
committed
DLE-190520-Uncomment hidden testcases in unit test
1 parent 0f647ce commit 420e8c0

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
__pycache__
2-
.vscode/settings.json
2+
.vscode/
33
temp
44
*.pkl
5+
app_build/model_trained/*
6+
app_build/ExchangeRatesPrediction.exe
7+
ExchangeRatesPrediction.exe

__main__.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def mainProcess(self):
2727

2828
print("Welcome to Exchange Rates Service!")
2929
option = input("Which services do you want to use?: \
30-
\n1. Predict tight range of matching (Quick process) \
31-
\n2. Predict wide range of matching (Long process) \
32-
\n3. Check exchange rates of specific currency \
33-
\n4. Check all exchange rates \
30+
\n1 - Predict tight range of matching (Quick process) \
31+
\n2 - Predict wide range of matching (Long process) \
32+
\n3 - Check exchange rates of specific currency \
33+
\n4 - Check all exchange rates \
3434
\nAny key to quit... \
3535
\nPlease input your choice's number: ").strip()
3636

@@ -77,10 +77,10 @@ def mainProcess(self):
7777
print("-"*30 + "PROCESS DONE" + "-"*30)
7878

7979
option = input("Which services do you want to use?: \
80-
\n1. Predict tight range of matching (Quick process) \
81-
\n2. Predict wide range of matching (Long process) \
82-
\n3. Check exchange rates of specific currency \
83-
\n4. Check all exchange rates \
80+
\n1 - Predict tight range of matching (Quick process) \
81+
\n2 - Predict wide range of matching (Long process) \
82+
\n3 - Check exchange rates of specific currency \
83+
\n4 - Check all exchange rates \
8484
\nAny key to quit... \
8585
\nPlease input your choice's number: ").strip()
8686

@@ -121,7 +121,8 @@ def validateInput(self, option, checkedDate, baseCurrency, toCurrency):
121121

122122

123123
### BUILD APP
124-
# Step 1: Put all images folder to "dist" folder (folder to deploy app)
125-
# Step 2: Open CMD/Terminal and change directory path to main python script
126-
# Step 3: Run command in first time => pyinstaller --clean --distpath=./app_build --workpath=./temp --onefile --name ExchangeRatesPrediction ./__main__.py
124+
# Step 1: Put all neccessary media/config files to build folder (folder to deploy app)
125+
# Step 2: Open CMD/Terminal and change directory path to main python script (__main__.py)
126+
# Step 3: Run command pip install these packages: pyinstaller, tornado, pypiwin32
127+
# Step 4: Run command in first time => pyinstaller --clean --distpath=./app_build --workpath=./temp --onefile --name ExchangeRatesPrediction ./__main__.py
127128
# Or Run this command when already have .spec file => pyinstaller --clean --distpath=./app_build --workpath=./temp --add-data="config.json;." --add-data="/model_trained/linear_model.pkl;." --onefile ExchangeRatesPrediction.spec

unit_tests/test_service.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@ class ServiceTestCase(unittest.TestCase):
2323

2424

2525

26-
# def test_exrate__get_exrate_byDate(self):
26+
def test_exrate__get_exrate_byDate(self):
2727

28-
# datereport = '2016-01-15'
29-
# baseCurrency = 'USD'
28+
datereport = '2016-01-15'
29+
baseCurrency = 'USD'
3030

31-
# service = ExchangeRateService()
32-
# data = service.get_exrate_byDate(ServiceTestCase.ApiCheckExcRateConfig, datereport, baseCurrency)
31+
service = ExchangeRateService()
32+
data = service.get_exrate_byDate(ServiceTestCase.ApiCheckExcRateConfig, datereport, baseCurrency)
3333

34-
# self.assertIsNotNone(data, '###Error Message: No data')
34+
self.assertIsNotNone(data, '###Error Message: No data')
3535

3636

37-
# def test_exrate__get_specific_exrate_byDate(self):
37+
def test_exrate__get_specific_exrate_byDate(self):
3838

39-
# datereport = '2016-01-15'
40-
# baseCurrency = 'USD'
41-
# toCurrency = 'EUR'
39+
datereport = '2016-01-15'
40+
baseCurrency = 'USD'
41+
toCurrency = 'EUR'
4242

43-
# service = ExchangeRateService()
44-
# data = service.get_specific_exrate_byDate(ServiceTestCase.ApiCheckExcRateConfig, datereport, baseCurrency, toCurrency)
43+
service = ExchangeRateService()
44+
data = service.get_specific_exrate_byDate(ServiceTestCase.ApiCheckExcRateConfig, datereport, baseCurrency, toCurrency)
4545

46-
# self.assertIsNotNone(data, '###Error Message: No data')
46+
self.assertIsNotNone(data, '###Error Message: No data')
4747

4848

4949
def test_exrate__get_specific_exrate_byDateRange(self):

0 commit comments

Comments
 (0)