Skip to content

Commit

Permalink
chore: suit review
Browse files Browse the repository at this point in the history
  • Loading branch information
clintval committed Nov 7, 2024
1 parent 0325f9c commit 9ac8724
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ def test_bed_writer_write_comment_with_prefix_pound_symbol(tmp_path: Path) -> No
writer = BedWriter[Bed2](handle)
writer.write_comment("# hello mom!")
writer.write(Bed2(refname="chr1", start=1))
writer.write_comment("# hello dad!")
writer.write_comment("# hello\ndad!")
writer.write(Bed2(refname="chr2", start=2))

expected = "# hello mom!\nchr1\t1\n# hello dad!\nchr2\t2\n"
expected = "# hello mom!\nchr1\t1\n# hello\n# dad!\nchr2\t2\n"
assert Path(tmp_path / "test.bed").read_text() == expected


Expand All @@ -131,15 +131,16 @@ def test_bed_writer_write_comment_without_prefix_pound_symbol(tmp_path: Path) ->
writer = BedWriter[Bed2](handle)
writer.write_comment("track this-is-fine")
writer.write_comment("browser is mario's enemy?")
writer.write_comment("hello mom!")
writer.write_comment("hello\nmom!")
writer.write(Bed2(refname="chr1", start=1))
writer.write_comment("hello dad!")
writer.write(Bed2(refname="chr2", start=2))

expected = (
"track this-is-fine\n"
"browser is mario's enemy?\n"
"# hello mom!\n"
"# hello\n"
"# mom!\n"
"chr1\t1\n"
"# hello dad!\n"
"chr2\t2\n"
Expand Down Expand Up @@ -206,7 +207,7 @@ def test_bed_reader_can_read_bed_records_with_comments(tmp_path: Path) -> None:

with open(tmp_path / "test.bed", "w") as handle:
writer: BedWriter = BedWriter(handle)
writer.write_comment("track this-is-fine")
writer.write_comment("track\nthis-is-fine")
writer.write_comment("browser is mario's enemy?")
writer.write_comment("hello mom!")
handle.write("\n") # empty line
Expand Down

0 comments on commit 9ac8724

Please sign in to comment.