Ejemplo n.º 1
0
def make_sample():
    filename: str = "sample"
    sample_size: int = 2
    try:
        create_sample_files(filename, sample_size)
    except Exception as e:
        # print(e)
        logger.error(e)
Ejemplo n.º 2
0
    def test_create_sample_files(self):
        filename = "test_sample"
        samplesize = 1000
        create_sample_files(filename, samplesize)

        file_named = "test_1.csv"
        result = open_csv(file_named)
        assert len(result) == samplesize - 1
Ejemplo n.º 3
0
    def test_create_sample_files_exception(self):
        filename = "test_sample"
        samplesize = 1000

        file_named = "test_2.csv"
        # result = open_csv(file_named)
        m = mock.Mock()
        m.side_effect = Exception(create_sample_files(filename, samplesize))
        try:
            m()
        except Exception:
            assert True