Esempio n. 1
0
def Number_lines_are_printed_without_quotes__test():
    out = StringIO()
    csv = Csv( out, ( "a", "b", "c" ) )
    csv.line( ( 2, "x", 3.5 ) )
    assert_equal(
        '''"a", "b", "c"
2, "x", 3.5
''',
        out.getvalue()
    )
Esempio n. 2
0
def String_lines_are_printed_in_quotes__test():
    out = StringIO()
    csv = Csv( out, ( "a", "b" ) )
    csv.line( ( "x", "y" ) )
    assert_equal(
        '''"a", "b"
"x", "y"
''',
        out.getvalue()
    )
def Number_lines_are_printed_without_quotes__test():
    out = StringIO()
    csv = Csv(out, ("a", "b", "c"))
    csv.line((2, "x", 3.5))
    assert_equal(
        """"a", "b", "c"
2, "x", 3.5
""",
        out.getvalue(),
    )
def String_lines_are_printed_in_quotes__test():
    out = StringIO()
    csv = Csv(out, ("a", "b"))
    csv.line(("x", "y"))
    assert_equal(
        """"a", "b"
"x", "y"
""",
        out.getvalue(),
    )
Esempio n. 5
0
def Multiple_lines_are_printed__test():
    out = StringIO()
    csv = Csv( out, ( "a", "b", "c" ) )
    csv.line( ( 2, "x", 3.5 ) )
    csv.line( ( 4, "y", 5.5 ) )
    assert_equal(
        '''"a", "b", "c"
2, "x", 3.5
4, "y", 5.5
''',
        out.getvalue()
    )
def Multiple_lines_are_printed__test():
    out = StringIO()
    csv = Csv(out, ("a", "b", "c"))
    csv.line((2, "x", 3.5))
    csv.line((4, "y", 5.5))
    assert_equal(
        """"a", "b", "c"
2, "x", 3.5
4, "y", 5.5
""",
        out.getvalue(),
    )
Esempio n. 7
0
def main( argv, out, err ):
    try:
        git = Git( RawGit() )
        csv = Csv(
            out,
            ( "Commit", "Date", "Author", "Added", "Removed", "File" )
        )
        for cod in expand_lines( git, expand_authors( git.log() ) ):
            csv.line( (
                cod.commit_hash,
                cod.date.date().isoformat(),
                cod.author,
                cod.added,
                cod.removed,
                cod.filename,
            ) )
    except subprocess.CalledProcessError as e:
        print(str( e ))
        sys.exit( 1 )
    finally:
        out.flush()