Skip to content

Commit

Permalink
correct typo smallest_shortage
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinFasusi committed Nov 7, 2017
1 parent aeb4656 commit a17c952
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Cython==0.27.2
Cython==0.27.3
Flask==0.12.2
Flask-RESTful==0.3.6
Flask-Restless==0.17.0
Expand All @@ -10,7 +10,7 @@ nltk==3.2.5
numpy==1.13.3
pandas==0.21.0
scipy==1.0.0
simplejson==3.11.1
SQLAlchemy==1.1.14
simplejson==3.12.0
SQLAlchemy==1.1.15
textblob==0.13.0
WTForms==2.1
Binary file modified supplychainpy/_pickled/application_config.pickle
Binary file not shown.
Binary file modified supplychainpy/sample_data/profile.pickle
Binary file not shown.
Binary file modified supplychainpy/sample_data/recommendation.pickle
Binary file not shown.
14 changes: 13 additions & 1 deletion tests/test_bot_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from supplychainpy._helpers._pickle_config import serialise_config
from supplychainpy.bot._controller import excess_controller, shortage_controller, revenue_controller, \
inventory_turns_controller, average_orders_controller, safety_stock_controller, reorder_level_controller
from supplychainpy.bot.dash import ChatBot
from supplychainpy.launch_reports import load_db
from supplychainpy.reporting.config.settings import IntegrationConfig
from supplychainpy.reporting.extensions import db
Expand Down Expand Up @@ -54,7 +55,7 @@ def test_controllers(self):
largest_inventory_turns = inventory_turns_controller(database_connection_uri(retrieve='retrieve'), direction='biggest')
smallest_average_orders = average_orders_controller(database_connection_uri(retrieve='retrieve'), direction='smallest')
biggest_average_orders = average_orders_controller(database_connection_uri(retrieve='retrieve'), direction='biggest')
smallest_safety_stock = safety_stock_controller(database_connection_uri(retrieve='retrieve'), direction='smallest')
smallest_safety_stock = safety_stock_controller(database_connection_uri(retrieve='retrieve'), direction='smallest')
biggest_safety_stock = safety_stock_controller(database_connection_uri(retrieve='retrieve'), direction='biggest`')
smallest_reorder_level = reorder_level_controller(database_connection_uri(retrieve='retrieve'), direction='smallest')
biggest_reorder_level = reorder_level_controller(database_connection_uri(retrieve='retrieve'), direction='biggest')
Expand All @@ -68,3 +69,14 @@ def test_controllers(self):
for i in result:
self.assertTrue(ses_file_regex.match(i[1]))

salutation = ["hi", "hello", "how's tricks?"]
dude = ChatBot()
greeting1 = dude.chat_machine("hello")[0]
self.assertIn(*greeting1, salutation)
self.assertEqual('<a href="/sku_detail/6">Here you go!</a>', *dude.chat_machine("show KR202-214")[0])
self.assertIn('SKU KR202-209',*dude.chat_machine("what is the biggest shortage?")[0])
self.assertIn('SKU KR202-215',*dude.chat_machine("what is the biggest excess?")[0])
self.assertIn('SKU KR202-209',*dude.chat_machine("what is the biggest revenue?")[0])
self.assertIn('SKU KR202-212',*dude.chat_machine("what is the smallest revenue?")[0])
self.assertIn('SKU KR202-213',*dude.chat_machine("Which SKU has the smallest average order?")[0])
self.assertIn('SKU KR202-212',*dude.chat_machine("Which SKU has the greatest safety stock?")[0])

0 comments on commit a17c952

Please sign in to comment.