Esempio n. 1
0
 def test_ftd_desc1(self):
     command = "course edit desc=Its fun to drive"
     output = {
         'command': 'course',
         'action': 'edit',
         'desc': 'Its fun to drive'
     }
     self.assertDictEqual(views.fieldsToDict(command), output)
Esempio n. 2
0
 def test_ftd_desc3(self):
     command = "course edit dnum=CS desc=Its fun to drive cnum=351"
     output = {
         'cnum': '351',
         'dnum': 'CS',
         'command': 'course',
         'action': 'edit',
         'desc': 'Its fun to drive'
     }
     self.assertDictEqual(views.fieldsToDict(command), output)
Esempio n. 3
0
 def test_ftd_code2(self):
     command = "course edit code=CS-550 ins=Danny"
     output = {
         'dnum': 'CS',
         'cnum': '550',
         'command': 'course',
         'action': 'edit',
         'ins': 'Danny'
     }
     self.assertDictEqual(views.fieldsToDict(command), output)
Esempio n. 4
0
 def test_ftd_code1(self):
     command = "course add code=CS-351-601"
     output = {
         'dnum': 'CS',
         'cnum': '351',
         'snum': '601',
         'command': 'course',
         'action': 'add'
     }
     self.assertDictEqual(views.fieldsToDict(command), output)
Esempio n. 5
0
 def test_ftd_code_desc2(self):
     command = "course edit ins=Dan code=CS-351-601 desc=Its fun to drive"
     output = {
         'cnum': '351',
         'dnum': 'CS',
         'snum': '601',
         'command': 'course',
         'action': 'edit',
         'desc': 'Its fun to drive',
         'ins': 'Dan'
     }
     self.assertDictEqual(views.fieldsToDict(command), output)
Esempio n. 6
0
 def test_val_sup4(self):
     command = views.fieldsToDict("course edit code=CS-351 ins=ins1")
     self.assertTrue(views.validate(command, self.UserDict['sup']))
Esempio n. 7
0
 def test_val_sup3(self):
     command = views.fieldsToDict("section edit code=CS-351 ta=ta1")
     self.assertTrue(views.validate(command, self.UserDict['sup']))
Esempio n. 8
0
 def test_val_sup2(self):
     command = views.fieldsToDict("user edit")
     self.assertTrue(views.validate(command, self.UserDict['sup']))
Esempio n. 9
0
 def test_val_sup1(self):
     command = views.fieldsToDict("course create")
     self.assertTrue(views.validate(command, self.UserDict['sup']))
Esempio n. 10
0
 def test_val_admin4(self):
     command = views.fieldsToDict("course edit ins=ins1")
     self.assertFalse(views.validate(command, self.UserDict['admin']))
Esempio n. 11
0
 def test_val_ta1(self):
     command = views.fieldsToDict("user edit username=default")
     self.assertTrue(views.validate(command, self.UserDict['ta']))
Esempio n. 12
0
 def test_val_ins4(self):
     command = views.fieldsToDict("section add")
     self.assertFalse(views.validate(command, self.UserDict['ins']))
Esempio n. 13
0
 def test_val_ins2(self):
     command = views.fieldsToDict("section view")
     self.assertTrue(views.validate(command, self.UserDict['ins']))
Esempio n. 14
0
 def test_val_ta4(self):
     command = views.fieldsToDict("section edit code=CS-351 ta=default")
     self.assertFalse(views.validate(command, self.UserDict['ta']))
Esempio n. 15
0
 def test_val_ta3(self):
     command = views.fieldsToDict("user add")
     self.assertFalse(views.validate(command, self.UserDict['ta']))
Esempio n. 16
0
 def test_val_ta2(self):
     command = views.fieldsToDict("course view")
     self.assertTrue(views.validate(command, self.UserDict['ta']))
Esempio n. 17
0
 def test_val_admin3(self):
     command = views.fieldsToDict("section edit ta=ta1")
     self.assertFalse(views.validate(command, self.UserDict['admin']))
Esempio n. 18
0
 def test_val_admin1(self):
     command = views.fieldsToDict("course add")
     self.assertTrue(views.validate(command, self.UserDict['admin']))
Esempio n. 19
0
 def test_val_default4(self):
     command = views.fieldsToDict("course add")
     self.assertFalse(views.validate(command, self.UserDict['default']))