Skip to content

Commit

Permalink
test for csvScriptBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitri-schmidt committed Jun 4, 2015
1 parent 955b298 commit 067197b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test_csvScriptBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
from mock import Mock
from mock import patch
import os.path
import csv

Expand Down Expand Up @@ -513,6 +514,14 @@ def test_write_into_csv_file_not_null(self):
assert self.builder.write_one_line.call_count == 0


def test_write_element_into_csv_stripable_constraint(self):
self.builder.parameters = {'property': u'P580,P582'}
uuid.uuid4 = Mock(return_value="much unique such value")
self.builder.write_element_into_csv(1929394, " funneh constraintname ")
self.csv_file.close()
with open("testData/test_constraints.csv", "rb") as csv:
assert csv.read() == 'much unique such value,1929394,funneh constraintname,"{""property"": ""P580,P582""}"\r\n'

def test_split_list_parameter_splitable(self):
test_line = "asdf:xyz"
assert self.builder.parameters == {}
Expand Down

0 comments on commit 067197b

Please sign in to comment.