Exemplo n.º 1
0
 def test_upload_unknown(self):
     with self.assertRaises(Exception):
         Uploader.upload(storetype='other',
                         url='mongodb://localhost:27017/',
                         database='programy',
                         filename=None,
                         dirname=self.basepath + "categories",
                         subdir=True,
                         extension=".aiml")
Exemplo n.º 2
0
 def test_upload_no_dir_or_file(self):
     with self.assertRaises(Exception):
         Uploader.upload(storetype='categories',
                         url='mongodb://localhost:27017/',
                         database='programy',
                         filename=None,
                         dirname=None,
                         subdir=True,
                         extension=".aiml")
Exemplo n.º 3
0
 def test_upload_categories(self):
     count, success = Uploader.upload(storetype='categories',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=None,
                                      dirname=self.basepath + "categories",
                                      subdir=True,
                                      extension=".aiml")
     self.assertEquals(9, count)
     self.assertEquals(9, success)
Exemplo n.º 4
0
 def test_upload_maps(self):
     count, success = Uploader.upload(storetype='maps',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=None,
                                      dirname=self.basepath + "maps" +
                                      os.sep + "text",
                                      subdir=True,
                                      extension=".txt")
     self.assertEquals(11, count)
     self.assertEquals(11, success)
Exemplo n.º 5
0
 def test_upload_usergroups(self):
     count, success = Uploader.upload(storetype='usergroups',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=self.basepath + "security" +
                                      os.sep + "roles.yaml",
                                      dirname=None,
                                      subdir=True,
                                      extension=".txt")
     self.assertEquals(1, count)
     self.assertEquals(1, success)
Exemplo n.º 6
0
 def test_upload_oobs(self):
     count, success = Uploader.upload(storetype='oobs',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=self.basepath + "oobs" +
                                      os.sep + "callmom.conf",
                                      dirname=None,
                                      subdir=True,
                                      extension=".conf")
     self.assertEquals(13, count)
     self.assertEquals(13, success)
Exemplo n.º 7
0
 def test_upload_licenses(self):
     count, success = Uploader.upload(storetype='licenses',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=self.basepath + "licenses" +
                                      os.sep + "test_license.keys",
                                      dirname=None,
                                      subdir=True,
                                      extension=".txt")
     self.assertEquals(4, count)
     self.assertEquals(2, success)
Exemplo n.º 8
0
 def test_upload_spelling(self):
     count, success = Uploader.upload(storetype='spelling',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=self.basepath + "spelling" +
                                      os.sep + "corpus.txt",
                                      dirname=None,
                                      subdir=True,
                                      extension=".txt")
     self.assertEquals(9, count)
     self.assertEquals(9, success)
Exemplo n.º 9
0
 def test_upload_postquestionprocessors(self):
     count, success = Uploader.upload(storetype='postquestionprocessors',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=self.basepath + "lookups" +
                                      os.sep + "text" + os.sep +
                                      "postquestionprocessors.conf",
                                      dirname=None,
                                      subdir=True,
                                      extension=".conf")
     self.assertEquals(6, count)
     self.assertEquals(5, success)
Exemplo n.º 10
0
 def test_upload_templatenodes(self):
     count, success = Uploader.upload(storetype='templatenodes',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=self.basepath + "lookups" +
                                      os.sep + "text" + os.sep +
                                      "template_nodes.conf",
                                      dirname=None,
                                      subdir=True,
                                      extension=".conf")
     self.assertEquals(71, count)
     self.assertEquals(64, success)
Exemplo n.º 11
0
 def test_upload_regexes(self):
     count, success = Uploader.upload(storetype='regexes',
                                      url='mongodb://localhost:27017/',
                                      database='programy',
                                      filename=self.basepath + "lookups" +
                                      os.sep + "text" + os.sep +
                                      "regex-templates.txt",
                                      dirname=None,
                                      subdir=True,
                                      extension=".txt")
     self.assertEquals(16, count)
     self.assertEquals(16, success)