コード例 #1
0
 def shouldPutMessageInCellForUnprintableAttributeInSurplusRow(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>Huh</td><td>c3</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"),
         ProcObj("Lord", "Lova", "Duck"), {
             "c1": "Larry",
             "Huh": "Moe",
             "c3": "Curly"
         }, {
             "c1": "Larry",
             "Huh": u"\u00a1",
             "c3": "Curly"
         }
     ]
     coll[0].Huh = "Blind"
     coll[1].Huh = "says to"
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.doTable(table)
     ##        em("\n%s" % table.toNodeList())
     cell = table.parts.more.more.more.more.more.parts.more
     ##        em("tag: %s body: %s" % (cell.tag, cell.body))
     assert cell.body.find("[error extracting value]") > -1
     assert fix.counts == Counts(8, 2, 0, 1)
コード例 #2
0
 def testExtractListParmOfLengthThree(self):
     fuList = ["snafu", "spam", "fubar"]
     obj = RowFixture(fuList, {})
     obj.setActualCollection()
     assert obj.paramCollection == fuList
     assert obj.actuals == fuList
     assert id(obj.actuals) != id(fuList)
     assert obj.paramTypeDict == {}
コード例 #3
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
 def testExtractDictParm(self):
     fuDict = {1: "snafu", 3: "fubar"}
     fuList = ["snafu", "fubar"]
     obj = RowFixture(fuDict, {})
     obj.setActualCollection()
     assert obj.paramCollection == fuDict
     assert obj.actuals == fuList
     assert obj.paramTypeDict == {}
コード例 #4
0
 def testExtractDictParm(self):
     fuDict = {1: "snafu", 3: "fubar"}
     fuList = ["snafu", "fubar"]
     obj = RowFixture(fuDict, {})
     obj.setActualCollection()
     assert obj.paramCollection == fuDict
     assert obj.actuals == fuList
     assert obj.paramTypeDict == {}
コード例 #5
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
 def testExtractListParmOfLengthThree(self):
     fuList = ["snafu", "spam", "fubar"]
     obj = RowFixture(fuList, {})
     obj.setActualCollection()
     assert obj.paramCollection == fuList
     assert obj.actuals == fuList
     assert id(obj.actuals) != id(fuList)
     assert obj.paramTypeDict == {}
コード例 #6
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
 def shouldUnmatchedRow(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [ProcObj("Three", "Blind", "Mice"),
             {"c1": "Larry", "c2": "Moe", "c3": "Curly"}]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.doTable(table)
     assert fix.counts.right == 6
コード例 #7
0
 def shouldMarkIncorrectSymbolReferenceAsWrong(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>c2</td><td>c3=</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>a</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>b</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>c</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"),
         ProcObj("Lord", "Lova", "Duck"), {
             "c1": "Larry",
             "c2": "Moe",
             "c3": "Curly"
         }
     ]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.setSymbol("a", "Mice")
     fix.setSymbol("b", "Duck")
     fix.setSymbol("c", "Laurel")
     fix.doTable(table)
     ##        label1 = table.parts.more.parts
     ##        em("\n%s" % table.toNodeList())
     ##        cell = table.parts.more.more.more.more.parts.more.more
     ##        em("tag: %s body: %s" % (cell.tag, cell.body))
     assert fix.counts == Counts(8, 1)
コード例 #8
0
 def shouldPostExceptionInParameterCellIfSymbolMissing(self):
     fix = RowFixture()
     unused = CollSymbol(
         [AnObject(1), AnObject(2), AnObject(3)], AnObject._typeDict)
     FitGlobal.testLevelSymbols = {}
     table = Parse(
         "<table><tr><td>fit.RowFixture</td><td>aCollection</td></tr>"
         "<tr><td>output</td></tr>"
         "<tr><td>1</td></tr>"
         "<tr><td>2</td></tr>"
         "<tr><td>3</td></tr></table>")
     fix.doTables(table)
     parmCell = table.parts.parts.more
     assert parmCell.tagIsError()
     assert table.parts.more.more.more.more.more is None
コード例 #9
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
 def shouldPostExceptionInParameterCellIfSymbolMissing(self):
     fix = RowFixture()
     unused = CollSymbol([AnObject(1), AnObject(2), AnObject(3)],
                       AnObject._typeDict)
     FitGlobal.testLevelSymbols = {}
     table = Parse(
         "<table><tr><td>fit.RowFixture</td><td>aCollection</td></tr>"
         "<tr><td>output</td></tr>"
         "<tr><td>1</td></tr>"
         "<tr><td>2</td></tr>"
         "<tr><td>3</td></tr></table>")
     fix.doTables(table)
     parmCell = table.parts.parts.more
     assert parmCell.tagIsError()
     assert table.parts.more.more.more.more.more is None
コード例 #10
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
 def shouldHandleUndefinedAttributeInCollectionElement(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [ProcObj("Three", "Blind", "Mice"),
             ProcObj("Lord", "Lova", "Duck"),
             {"missing": "Larry", "c2": "Moe", "c3": "Curly"}]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.doTable(table)
     assert fix.counts == Counts(6, 3)
コード例 #11
0
 def testMissingLabelRow(self):
     obj = RowFixture(["fuString"], {})
     table = Parse("<table><tr><td>fit.RowFixture</td></tr></table>")
     self._doTable(obj, table)
     headCell = table.parts.parts
     assert headCell.tagIsError()
     assert headCell.body.find("Row containing column") > -1
     assert self.exceptionWasPropagated
コード例 #12
0
 def shouldUnmatchedRow(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"), {
             "c1": "Larry",
             "c2": "Moe",
             "c3": "Curly"
         }
     ]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.doTable(table)
     assert fix.counts.right == 6
コード例 #13
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
    def shouldHandleUndefinedColumnWithStringMismatch(self):
        table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                      "<tr><td>c1</td><td>Huh</td><td>c3</td></tr>"
                      "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                      "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                      "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                      "</table>")
        coll = [ProcObj("Three", "Blind", "Mice"),
                ProcObj("Lord", "Lova", "Duck"),
                {"c1": "Larry", "Huh": "Moe", "c3": "Curly"}]
        coll[0].Huh = "Blind"
        coll[1].Huh = "says to"
        metaData = {"c1": "String", "c2": "String", "c3": "String"}
        fix = RowFixture(coll, metaData)
        fix.doTable(table)
##        em("\n%s" % table.toNodeList())
##        cell = table.parts.more.parts.more
##        em("tag: %s body: %s" % (cell.tag, cell.body))
        assert fix.counts == Counts(8, 1, 0, 1)
コード例 #14
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
 def shouldHandleCollectionFromSymbol(self):
     fix = RowFixture()
     coll = CollSymbol([AnObject(1), AnObject(2), AnObject(3)],
                       AnObject._typeDict)
     fix.setSymbol("aCollection", coll)
     table = Parse(
         "<table><tr><td>fit.RowFixture</td><td>aCollection</td></tr>"
         "<tr><td>output</td></tr>"
         "<tr><td>1</td></tr>"
         "<tr><td>2</td></tr>"
         "<tr><td>3</td></tr></table>")
     fix.doTables(table)
     row1 = table.parts.more.more.parts
     row2 = table.parts.more.more.more.parts
     row3 = table.parts.more.more.more.more.parts
     assert row1.tagIsRight()
     assert row2.tagIsRight()
     assert row3.tagIsRight()
     assert table.parts.more.more.more.more.more is None
コード例 #15
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
    def shouldMarkShortRowAsMissingWithException(self):
        table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                      "<tr><td>c1</td><td>c2</td><td>c3</td></tr>"
                      "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                      "<tr><td>Lord</td><td>Lova</td></tr>"
                      "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                      "</table>")
        coll = [ProcObj("Three", "Blind", "Mice"),
                ProcObj("Lord", "Lova", "Duck"),
                {"c1": "Larry", "c2": "Moe", "c3": "Curly"}]
        metaData = {"c1": "String", "c2": "String", "c3": "String"}
        fix = RowFixture(coll, metaData)
        fix.doTable(table)
##        em("\n%s" % table.toNodeList())
##        label1 = table.parts.more.parts
##        em("tag: %s body: %s" % (label1.tag, label1.body))
##        cell = table.parts.more.more.more.parts
##        em("tag: %s body: %s" % (cell.tag, cell.body))
        assert fix.counts == Counts(6, 1, 0, 1)
コード例 #16
0
 def shouldHandleUndefinedAttributeInCollectionElement(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"),
         ProcObj("Lord", "Lova", "Duck"), {
             "missing": "Larry",
             "c2": "Moe",
             "c3": "Curly"
         }
     ]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.doTable(table)
     assert fix.counts == Counts(6, 3)
コード例 #17
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
 def shouldHandleSymbolicReferencesInFirstColumn(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1=</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>a</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>b</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>c</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [ProcObj("Three", "Blind", "Mice"),
             ProcObj("Lord", "Lova", "Duck"),
             {"c1": "Larry", "c2": "Moe", "c3": "Curly"}]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.setSymbol("a", "Three")
     fix.setSymbol("b", "Lord")
     fix.setSymbol("c", "Larry")
     fix.doTable(table)
     assert fix.counts.right == 9
コード例 #18
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
    def shouldPutMessageInCellForUnprintableAttributeInSurplusRow(self):
        table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                      "<tr><td>c1</td><td>Huh</td><td>c3</td></tr>"
                      "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                      "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                      "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                      "</table>")
        coll = [ProcObj("Three", "Blind", "Mice"),
                ProcObj("Lord", "Lova", "Duck"),
                {"c1": "Larry", "Huh": "Moe", "c3": "Curly"},
                {"c1": "Larry", "Huh": u"\u00a1", "c3": "Curly"}]
        coll[0].Huh = "Blind"
        coll[1].Huh = "says to"
        metaData = {"c1": "String", "c2": "String", "c3": "String"}
        fix = RowFixture(coll, metaData)
        fix.doTable(table)
##        em("\n%s" % table.toNodeList())
        cell = table.parts.more.more.more.more.more.parts.more
##        em("tag: %s body: %s" % (cell.tag, cell.body))
        assert cell.body.find("[error extracting value]") > -1
        assert fix.counts == Counts(8, 2, 0, 1)
コード例 #19
0
 def shouldHandleSymbolicReferencesInFirstColumn(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1=</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>a</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>b</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>c</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"),
         ProcObj("Lord", "Lova", "Duck"), {
             "c1": "Larry",
             "c2": "Moe",
             "c3": "Curly"
         }
     ]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.setSymbol("a", "Three")
     fix.setSymbol("b", "Lord")
     fix.setSymbol("c", "Larry")
     fix.doTable(table)
     assert fix.counts.right == 9
コード例 #20
0
 def shouldHandleUndefinedColumnWithStringMismatch(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>Huh</td><td>c3</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"),
         ProcObj("Lord", "Lova", "Duck"), {
             "c1": "Larry",
             "Huh": "Moe",
             "c3": "Curly"
         }
     ]
     coll[0].Huh = "Blind"
     coll[1].Huh = "says to"
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.doTable(table)
     ##        em("\n%s" % table.toNodeList())
     ##        cell = table.parts.more.parts.more
     ##        em("tag: %s body: %s" % (cell.tag, cell.body))
     assert fix.counts == Counts(8, 1, 0, 1)
コード例 #21
0
 def shouldMarkShortRowAsMissingWithException(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"),
         ProcObj("Lord", "Lova", "Duck"), {
             "c1": "Larry",
             "c2": "Moe",
             "c3": "Curly"
         }
     ]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.doTable(table)
     ##        em("\n%s" % table.toNodeList())
     ##        label1 = table.parts.more.parts
     ##        em("tag: %s body: %s" % (label1.tag, label1.body))
     ##        cell = table.parts.more.more.more.parts
     ##        em("tag: %s body: %s" % (cell.tag, cell.body))
     assert fix.counts == Counts(6, 1, 0, 1)
コード例 #22
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
 def shouldHandleMissingSymbolInPartitionStep(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1=</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>a</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>b</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>c</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [ProcObj("Three", "Blind", "Mice"),
             ProcObj("Lord", "Lova", "Duck"),
             {"c1": "Larry", "c2": "Moe", "c3": "Curly"}]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.setSymbol("b", "Lord")
     fix.setSymbol("c", "Larry")
     fix.doTable(table)
     assert fix.counts == Counts(6, 1, 2, 1)
コード例 #23
0
 def shouldHandleMissingSymbolInPartitionStep(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1=</td><td>c2</td><td>c3</td></tr>"
                   "<tr><td>a</td><td>Blind</td><td>Mice</td></tr>"
                   "<tr><td>b</td><td>Lova</td><td>Duck</td></tr>"
                   "<tr><td>c</td><td>Moe</td><td>Curly</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"),
         ProcObj("Lord", "Lova", "Duck"), {
             "c1": "Larry",
             "c2": "Moe",
             "c3": "Curly"
         }
     ]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.setSymbol("b", "Lord")
     fix.setSymbol("c", "Larry")
     fix.doTable(table)
     assert fix.counts == Counts(6, 1, 2, 1)
コード例 #24
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
    def shouldHandleSymbolicReferencesInLastColumn(self):
        table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                      "<tr><td>c1</td><td>c2</td><td>c3=</td></tr>"
                      "<tr><td>Three</td><td>Blind</td><td>a</td></tr>"
                      "<tr><td>Lord</td><td>Lova</td><td>b</td></tr>"
                      "<tr><td>Larry</td><td>Moe</td><td>c</td></tr>"
                      "</table>")
        coll = [ProcObj("Three", "Blind", "Mice"),
                ProcObj("Lord", "Lova", "Duck"),
                {"c1": "Larry", "c2": "Moe", "c3": "Curly"}]
        metaData = {"c1": "String", "c2": "String", "c3": "String"}
        fix = RowFixture(coll, metaData)
        fix.setSymbol("a", "Mice")
        fix.setSymbol("b", "Duck")
        fix.setSymbol("c", "Curly")
        fix.doTable(table)
#        label1 = table.parts.more.parts
        assert fix.counts == Counts(9)
コード例 #25
0
 def shouldHandleSymbolicReferencesInLastColumn(self):
     table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                   "<tr><td>c1</td><td>c2</td><td>c3=</td></tr>"
                   "<tr><td>Three</td><td>Blind</td><td>a</td></tr>"
                   "<tr><td>Lord</td><td>Lova</td><td>b</td></tr>"
                   "<tr><td>Larry</td><td>Moe</td><td>c</td></tr>"
                   "</table>")
     coll = [
         ProcObj("Three", "Blind", "Mice"),
         ProcObj("Lord", "Lova", "Duck"), {
             "c1": "Larry",
             "c2": "Moe",
             "c3": "Curly"
         }
     ]
     metaData = {"c1": "String", "c2": "String", "c3": "String"}
     fix = RowFixture(coll, metaData)
     fix.setSymbol("a", "Mice")
     fix.setSymbol("b", "Duck")
     fix.setSymbol("c", "Curly")
     fix.doTable(table)
     #        label1 = table.parts.more.parts
     assert fix.counts == Counts(9)
コード例 #26
0
ファイル: RowFixtureTest.py プロジェクト: copyleftdev/pyfit
    def shouldMarkIncorrectSymbolReferenceAsWrong(self):
        table = Parse("<table><tr><td>fit.RowFixture</td></tr>"
                      "<tr><td>c1</td><td>c2</td><td>c3=</td></tr>"
                      "<tr><td>Three</td><td>Blind</td><td>a</td></tr>"
                      "<tr><td>Lord</td><td>Lova</td><td>b</td></tr>"
                      "<tr><td>Larry</td><td>Moe</td><td>c</td></tr>"
                      "</table>")
        coll = [ProcObj("Three", "Blind", "Mice"),
                ProcObj("Lord", "Lova", "Duck"),
                {"c1": "Larry", "c2": "Moe", "c3": "Curly"}]
        metaData = {"c1": "String", "c2": "String", "c3": "String"}
        fix = RowFixture(coll, metaData)
        fix.setSymbol("a", "Mice")
        fix.setSymbol("b", "Duck")
        fix.setSymbol("c", "Laurel")
        fix.doTable(table)
##        label1 = table.parts.more.parts
##        em("\n%s" % table.toNodeList())
##        cell = table.parts.more.more.more.more.parts.more.more
##        em("tag: %s body: %s" % (cell.tag, cell.body))
        assert fix.counts == Counts(8, 1)
コード例 #27
0
 def shouldHandleCollectionFromSymbol(self):
     fix = RowFixture()
     coll = CollSymbol(
         [AnObject(1), AnObject(2), AnObject(3)], AnObject._typeDict)
     fix.setSymbol("aCollection", coll)
     table = Parse(
         "<table><tr><td>fit.RowFixture</td><td>aCollection</td></tr>"
         "<tr><td>output</td></tr>"
         "<tr><td>1</td></tr>"
         "<tr><td>2</td></tr>"
         "<tr><td>3</td></tr></table>")
     fix.doTables(table)
     row1 = table.parts.more.more.parts
     row2 = table.parts.more.more.more.parts
     row3 = table.parts.more.more.more.more.parts
     assert row1.tagIsRight()
     assert row2.tagIsRight()
     assert row3.tagIsRight()
     assert table.parts.more.more.more.more.more is None
コード例 #28
0
 def testErrorIfNotDictOrSequenceOrIterator(self):
     obj = RowFixture(3.14, {})
     self.assertRaises(FitException, obj.setActualCollection)
コード例 #29
0
 def testExtractUnsupportedParm(self):
     fuString = "Snafu"
     obj = RowFixture(fuString, {})
     self.assertRaises(FitException, obj.setActualCollection)