Example #1
0
 def testSillyTwoTables(self):
     if not self.can_run:
         return
     tdf = TicDatFactory(**sillyMeSchema())
     ticDat = tdf.TicDat(**sillyMeDataTwoTables())
     filePath = os.path.join(_scratchDir, "sillyMeTwoTables.xls")
     tdf.xls.write_file(ticDat, filePath)
     xlsTicDat = tdf.xls.create_tic_dat(filePath)
     self.assertTrue(tdf._same_data(ticDat, xlsTicDat))
Example #2
0
 def testSillyTwoTables(self):
     if not self.can_run:
         return
     tdf = TicDatFactory(**sillyMeSchema())
     ticDat = tdf.TicDat(**sillyMeDataTwoTables())
     dirPath = os.path.join(_scratchDir, "sillyTwoTables")
     tdf.csv.write_directory(ticDat, dirPath)
     self.assertFalse(tdf.csv.find_duplicates(dirPath))
     csvTicDat = tdf.csv.create_tic_dat(dirPath)
     self.assertTrue(tdf._same_data(ticDat, csvTicDat))
    def testSillyTwoTables(self):
        if not self.can_run:
            return
        for hack, raw_data in list(product(*(([True, False],)*2))):
            tdf = TicDatFactory(**sillyMeSchema())
            ticDat = tdf.TicDat(**sillyMeData())
            self.assertTrue(tdf._same_data(ticDat, tdf.opalytics.create_tic_dat(
                create_inputset_mock(tdf, ticDat, hack), raw_data=raw_data)))

            ticDat = tdf.TicDat(**sillyMeDataTwoTables())
            self.assertTrue(tdf._same_data(ticDat, tdf.opalytics.create_tic_dat(
                create_inputset_mock(tdf, ticDat, hack), raw_data=raw_data)))
Example #4
0
 def testSillyTwoTables(self):
     if not self.can_run:
         return
     tdf = TicDatFactory(**sillyMeSchema())
     tdf.set_data_type("a",
                       "aField",
                       strings_allowed='*',
                       number_allowed=True)
     ticDat = tdf.TicDat(**sillyMeDataTwoTables())
     dirPath = os.path.join(_scratchDir, "sillyTwoTables")
     tdf.csv.write_directory(ticDat, dirPath)
     self.assertFalse(tdf.csv.find_duplicates(dirPath))
     csvTicDat = tdf.csv.create_tic_dat(dirPath)
     self.assertTrue(tdf._same_data(ticDat, csvTicDat))
Example #5
0
    def testSillyTwoTables(self):
        if not self.can_run:
            return

        for verbose in [True, False]:

            tdf = TicDatFactory(**sillyMeSchema())
            ticDat = tdf.TicDat(**sillyMeDataTwoTables())
            writePath = os.path.join(
                makeCleanDir(os.path.join(_scratchDir, "sillyTwoTables")),
                "file.json")
            tdf.json.write_file(ticDat, writePath, verbose=verbose)
            self.assertFalse(tdf.json.find_duplicates(writePath))
            jsonTicDat = tdf.json.create_tic_dat(writePath)
            self.assertTrue(tdf._same_data(ticDat, jsonTicDat))
    def testSillyTwoTablesOpalytics(self):
        if not self.can_run:
            return
        for hack, raw_data in list(itertools.product(*(([True, False], ) *
                                                       2))):
            tdf = TicDatFactory(**sillyMeSchema())
            ticDat = tdf.TicDat(**sillyMeData())

            inputset = create_inputset_mock(tdf, ticDat, hack)
            pdf = PanDatFactory(**tdf.schema())
            panDat = pdf.opalytics.create_pan_dat(inputset, raw_data=raw_data)
            self.assertTrue(tdf._same_data(ticDat,
                                           pdf.copy_to_tic_dat(panDat)))

            ticDat = tdf.TicDat(**sillyMeDataTwoTables())
            inputset = create_inputset_mock(tdf, ticDat, hack)
            pdf = PanDatFactory(**tdf.schema())
            panDat = pdf.opalytics.create_pan_dat(inputset, raw_data=raw_data)
            self.assertTrue(tdf._same_data(ticDat,
                                           pdf.copy_to_tic_dat(panDat)))