How to use the clevercsv.normal_form.is_form_4 function in clevercsv

To help you get started, we’ve selected a few clevercsv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))
github alan-turing-institute / CleverCSV / tests / test_unit / test_normal_forms.py View on Github external
def test_form_4(self):
        quoted = SimpleDialect(delimiter="", quotechar='"', escapechar="")
        unquoted = SimpleDialect(delimiter="", quotechar="", escapechar="")

        self.assertTrue(is_form_4("A\nB\nC", unquoted))
        self.assertTrue(is_form_4("1\n2\n3", unquoted))
        self.assertTrue(is_form_4("A_B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n1\n2", unquoted))
        self.assertTrue(is_form_4("A&B\n-1\n2", unquoted))
        self.assertTrue(is_form_4('"A"\n"B"\n"C"\n', quoted))

        self.assertFalse(is_form_4('"A", "B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A","B"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('"A@b"\n"B"\n"C"\n', quoted))
        self.assertFalse(is_form_4('A\n"-1"\n2', unquoted))
        self.assertFalse(is_form_4("A B\n-1 3\n2 4", unquoted))