-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from panditanvita/dev
Dev
- Loading branch information
Showing
6 changed files
with
186 additions
and
39 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
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,35 @@ | ||
__author__ = 'V' | ||
|
||
from MovieBot.classes import * | ||
from MovieBot.showtime import * | ||
|
||
# for testing, we want known ntm, ntt dictionaries | ||
def get_info(): | ||
req1 = MovieRequest("test") | ||
req2 = MovieRequest("test") | ||
|
||
ntt, ntm = {}, {} | ||
|
||
times1 = [Time('6pm'), Time('630pm'), Time('730pm')] | ||
times2 = [Time('9am'), Time('1030am'), Time('1730pm'), Time('10pm')] | ||
|
||
#title, description, theatres | ||
m1 = Movie("Zabod") | ||
m2 = Movie("Interesting Short Stories") | ||
|
||
#bms_name, address, company | ||
t1 = Theatre("t1",['outer','ring''road'], 'pvr') | ||
t1.put('zabod',times1) | ||
t2 = Theatre("t2",['outer','koramangala'], 'cinemax') | ||
t2.put('zabod',times2) | ||
t3 = Theatre("t3",['marathalli'], 'innovative multiplex') | ||
t3.put('interesting short stories', times2) | ||
ntt['t1'] = t1 | ||
ntt['t2'] = t2 | ||
ntt['t3'] = t3 | ||
|
||
ntt['zabod'] = m1 | ||
ntt['interesting short stories'] = m2 | ||
|
||
req1.add_title('zabod') | ||
return req1, req2, ntm, ntt |
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,42 @@ | ||
__author__ = 'V' | ||
|
||
import unittest | ||
|
||
from MovieBot.logic import * | ||
|
||
from knowledge import get_info | ||
|
||
class Test_narrow(unittest.TestCase): | ||
req1, req2, ntm, ntt = get_info() | ||
|
||
def test_narrow_movies(self): | ||
tag_movs = [] | ||
r1 = narrow_movies(self.req1,tag_movs,self.ntm) | ||
self.assertEqual(r1, (0,"What movie?")) | ||
|
||
tag_movs = ['zabod'] | ||
r1_ = narrow_movies(self.req1, tag_movs, self.ntm) | ||
self.assertEqual(r1_, (0,"What movie?")) | ||
|
||
r1_1 = narrow_movies(self.req2, tag_movs, self.ntm) | ||
self.assertEqual(r1_1, (1,"")) | ||
|
||
|
||
def test_narrow_theatres(self): | ||
tag_theats = ['t1'] | ||
r2 = narrow_theatres(self.req1,tag_theats,self.ntt) | ||
|
||
self.assertTrue(r2, (0, "At which theatre?")) | ||
|
||
|
||
def test_narrow_num(self): | ||
self.assertTrue(True) | ||
|
||
|
||
|
||
def main(): | ||
unittest.main() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |