Пример #1
0
 def test_fails_on_broken_csv_with_plugins(self):
     cid_path = dev_test.path_to_example('cid_colors.ods')
     csv_path = dev_test.path_to_example('colors_broken.csv')
     exit_code = applications.process([
         'test_can_validate_proper_csv_with_plugins', '--plugins', dev_test.path_to_test_plugins(),
         cid_path, csv_path])
     self.assertEqual(1, exit_code)
Пример #2
0
 def test_fails_on_broken_csv_with_plugins(self):
     cid_path = dev_test.path_to_example('cid_colors.ods')
     csv_path = dev_test.path_to_example('colors_broken.csv')
     exit_code = applications.process([
         'test_can_validate_proper_csv_with_plugins', '--plugins',
         dev_test.path_to_test_plugins(), cid_path, csv_path
     ])
     self.assertEqual(1, exit_code)
Пример #3
0
 def test_can_read_cid_with_plugins(self):
     cid_path = dev_test.path_to_example('cid_colors.ods')
     exit_code = applications.process([
         'test_can_read_cid_with_plugins', '--plugins',
         dev_test.path_to_test_plugins(), cid_path
     ])
     self.assertEqual(0, exit_code)
Пример #4
0
from __future__ import print_function
from __future__ import unicode_literals

import logging
import os
import unittest

import six

from cutplace import applications
from tests import dev_test
from tests import _ods

_log = logging.getLogger("cutplace.test_applications")

_customers_cid_path = dev_test.path_to_example('cid_customers.ods')
_valid_customers_csv_path = dev_test.path_to_example('customers.csv')


def _assert_valid_customers_has_no_barret():
    import io
    with io.open(_valid_customers_csv_path, 'r',
                 encoding='cp1252') as customers_file:
        customers_content = customers_file.read()
    assert 'Barret' not in customers_content


class CutplaceAppTest(unittest.TestCase):
    def setUp(self):
        self._cutplace_app = applications.CutplaceApp()
        self._cutplace_app.set_cid_from_path(_customers_cid_path)
Пример #5
0
 def test_can_read_cid_with_plugins(self):
     cid_path = dev_test.path_to_example('cid_colors.ods')
     exit_code = applications.process(
         ['test_can_read_cid_with_plugins', '--plugins', dev_test.path_to_test_plugins(), cid_path])
     self.assertEqual(0, exit_code)
Пример #6
0
from __future__ import unicode_literals

import logging
import os
import unittest

import six

from cutplace import applications
from tests import dev_test
from tests import _ods


_log = logging.getLogger("cutplace.test_applications")

_customers_cid_path = dev_test.path_to_example('cid_customers.ods')
_valid_customers_csv_path = dev_test.path_to_example('customers.csv')


def _assert_valid_customers_has_no_barret():
    import io
    with io.open(_valid_customers_csv_path, 'r', encoding='cp1252') as customers_file:
        customers_content = customers_file.read()
    assert 'Barret' not in customers_content


class CutplaceAppTest(unittest.TestCase):
    def setUp(self):
        self._cutplace_app = applications.CutplaceApp()
        self._cutplace_app.set_cid_from_path(_customers_cid_path)
        self._broken_customers_non_csv_path = dev_test.path_to_test_data('valid_customers.ods')