示例#1
0
 def test_CreateCache_1(self):
     CreateCache('ZU1.txt', 'ZM1.txt')
     testUsers = getUsers()
     prototypeMovies = getMovies()
     testMovies = [0] * 2
     testMovies[0] = prototypeMovies[0]
     testMovies[1] = prototypeMovies[1]
     actualUsers = {'1' : 5.0, '2': 3.0}
     actualMovies = [5.0, 1.0]
     print testMovies
     self.assert_(testUsers == actualUsers)
     self.assert_(testMovies == actualMovies)
示例#2
0
 def test_CreateCache_1(self):
     CreateCache('ZU1.txt', 'ZM1.txt')
     testUsers = getUsers()
     prototypeMovies = getMovies()
     testMovies = [0] * 2
     testMovies[0] = prototypeMovies[0]
     testMovies[1] = prototypeMovies[1]
     actualUsers = {'1': 5.0, '2': 3.0}
     actualMovies = [5.0, 1.0]
     print testMovies
     self.assert_(testUsers == actualUsers)
     self.assert_(testMovies == actualMovies)
示例#3
0
 def test_CreateCache_3(self):
     CreateCache('ZU3.txt', 'ZM3.txt')
     testUsers = getUsers()
     prototypeMovies = getMovies()
     testMovies = [0] * 4
     testMovies[0] = round(prototypeMovies[0])
     testMovies[1] = round(prototypeMovies[1])
     testMovies[2] = round(prototypeMovies[2])
     testMovies[3] = round(prototypeMovies[3])
     actualUsers = {'1' : 5.0, '10034': 4.0, '2': 3.0, '8901267': 3.0}
     actualMovies = [4.0, 3.0, 4.0, 4.0]
     self.assert_(testUsers == actualUsers)
     self.assert_(testMovies == actualMovies)
示例#4
0
 def test_CreateCache_3(self):
     CreateCache('ZU3.txt', 'ZM3.txt')
     testUsers = getUsers()
     prototypeMovies = getMovies()
     testMovies = [0] * 4
     testMovies[0] = round(prototypeMovies[0])
     testMovies[1] = round(prototypeMovies[1])
     testMovies[2] = round(prototypeMovies[2])
     testMovies[3] = round(prototypeMovies[3])
     actualUsers = {'1': 5.0, '10034': 4.0, '2': 3.0, '8901267': 3.0}
     actualMovies = [4.0, 3.0, 4.0, 4.0]
     self.assert_(testUsers == actualUsers)
     self.assert_(testMovies == actualMovies)