Skip to content

Commit

Permalink
test house-of-councillor: reduce checking
Browse files Browse the repository at this point in the history
GitHub: red-data-toolsGH-188

Because csv file is too big (9,462 rows and 39 columns).

Before this change:

```console
$ time ruby test/run-test.rb -t HouseOfCouncillorTest:::bill --verbose=important-only
Finished in 2.352206 seconds.
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0
notifications

real    0m2.953s
user    0m2.701s
sys     0m0.153s
```

After this change:

```console
$ time ruby test/run-test.rb -t HouseOfCouncillorTest:::bill --verbose=important-only
Finished in 0.002077 seconds.
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0
notifications

real    0m0.566s
user    0m0.382s
sys     0m0.092s
```
  • Loading branch information
tikkss committed Sep 4, 2024
1 parent 004d29c commit 050e021
Showing 1 changed file with 40 additions and 87 deletions.
127 changes: 40 additions & 87 deletions test/test-house-of-councillor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,93 +16,46 @@ def record(*args)
end

test("#each") do
records = @dataset.each.to_a
assert_equal([
9462,
record(153,
"法律案(内閣提出)",
153,
1,
"司法制度改革推進法案",
"https://www.sangiin.go.jp/japanese/joho1/kousei/gian/153/meisai/m15303153001.htm",
"https://www.sangiin.go.jp/japanese/joho1/kousei/gian/153/pdf/5315310.pdf",
nil,
Date.parse("2001-09-28"),
Date.parse("2001-10-30"),
nil,
"衆先議",
nil,
nil,
nil,
nil,
Date.parse("2001-10-31"),
"法務委員会",
Date.parse("2001-11-08"),
"可決",
Date.parse("2001-11-09"),
"可決",
nil,
"多数",
"押しボタン",
"https://www.sangiin.go.jp/japanese/joho1/kousei/vote/153/153-1109-v005.htm",
Date.parse("2001-10-18"),
"法務委員会",
Date.parse("2001-10-26"),
"可決",
Date.parse("2001-10-30"),
"可決",
nil,
"多数",
"起立",
Date.parse("2001-11-16"),
119,
nil,
nil),
record(213,
"決議案",
213,
3,
"議院運営委員長浅尾慶一郎君解任決議案",
"https://www.sangiin.go.jp/japanese/joho1/kousei/gian/213/meisai/m213600213003.htm",
nil,
nil,
Date.parse("2024-06-19"),
nil,
nil,
nil,
nil,
"東徹君 外2名",
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
"令和6年6月20日 撤回"),
],
[
records.size,
records.first,
records.last,
])
assert_equal(record(153,
"法律案(内閣提出)",
153,
1,
"司法制度改革推進法案",
"https://www.sangiin.go.jp/japanese/joho1/kousei/gian/153/meisai/m15303153001.htm",
"https://www.sangiin.go.jp/japanese/joho1/kousei/gian/153/pdf/5315310.pdf",
nil,
Date.parse("2001-09-28"),
Date.parse("2001-10-30"),
nil,
"衆先議",
nil,
nil,
nil,
nil,
Date.parse("2001-10-31"),
"法務委員会",
Date.parse("2001-11-08"),
"可決",
Date.parse("2001-11-09"),
"可決",
nil,
"多数",
"押しボタン",
"https://www.sangiin.go.jp/japanese/joho1/kousei/vote/153/153-1109-v005.htm",
Date.parse("2001-10-18"),
"法務委員会",
Date.parse("2001-10-26"),
"可決",
Date.parse("2001-10-30"),
"可決",
nil,
"多数",
"起立",
Date.parse("2001-11-16"),
119,
nil,
nil),
@dataset.each.next)
end
end

Expand Down

0 comments on commit 050e021

Please sign in to comment.