Skip to content

Commit

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

Because csv file is too big (10,779 rows).

Before this change:

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

real    0m3.295s
user    0m3.031s
sys     0m0.152s
```

After this change:

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

real    0m0.659s
user    0m0.465s
sys     0m0.103s
```
  • Loading branch information
tikkss committed Sep 2, 2024
1 parent 778347c commit 708b41c
Showing 1 changed file with 42 additions and 91 deletions.
133 changes: 42 additions & 91 deletions test/test-house-of-representative.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,96 +8,47 @@ def record(*args)
end

test("#each") do
records = @dataset.each.to_a
assert_equal([
10779,
record(142,
"衆法の一覧",
nil,
139,
18,
"市民活動促進法案",
"成立",
"経過",
"https://www.shugiin.go.jp/internet/itdb_gian.nsf/html/gian/keika/5516.htm",
nil,
nil,
"衆法",
"熊代 昭彦君外四名",
%w(自由民主党 社会民主党・市民連合 新党さきがけ),
nil,
nil,
nil,
Date.jisx0301("H10.03.04"),
Date.jisx0301("H10.03.11"),
"内閣",
Date.jisx0301("H10.03.17"),
"可決",
Date.jisx0301("H10.03.19"),
"可決",
nil,
nil,
nil,
nil,
nil,
nil,
nil,
Date.jisx0301("H10.01.12"),
"労働・社会政策",
Date.jisx0301("H10.03.03"),
"修正",
Date.jisx0301("H10.03.04"),
"修正",
Date.jisx0301("H10.03.25"),
7,
nil,
nil),
record(213,
"規則の一覧",
nil,
213,
2,
"衆議院規則の一部を改正する規則案",
"本院可決",
"経過",
"https://www.shugiin.go.jp/internet/itdb_gian.nsf/html/gian/keika/1DDC37E.htm",
nil,
nil,
"規則",
"議院運営委員長",
nil,
nil,
nil,
nil,
Date.jisx0301("R06.06.21"),
nil,
"審査省略",
nil,
nil,
Date.jisx0301("R06.06.21"),
"可決",
"多数",
%w(自由民主党・無所属の会 立憲民主党・無所属 日本維新の会・教育無償化を実現する会 公明党 国民民主党・無所属クラブ 有志の会 れいわ新選組),
%w(日本共産党),
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
%w(山口俊一君),
nil),
],
[
records.size,
records.first,
records.last,
])
assert_equal(record(142,
"衆法の一覧",
nil,
139,
18,
"市民活動促進法案",
"成立",
"経過",
"https://www.shugiin.go.jp/internet/itdb_gian.nsf/html/gian/keika/5516.htm",
nil,
nil,
"衆法",
"熊代 昭彦君外四名",
%w(自由民主党 社会民主党・市民連合 新党さきがけ),
nil,
nil,
nil,
Date.jisx0301("H10.03.04"),
Date.jisx0301("H10.03.11"),
"内閣",
Date.jisx0301("H10.03.17"),
"可決",
Date.jisx0301("H10.03.19"),
"可決",
nil,
nil,
nil,
nil,
nil,
nil,
nil,
Date.jisx0301("H10.01.12"),
"労働・社会政策",
Date.jisx0301("H10.03.03"),
"修正",
Date.jisx0301("H10.03.04"),
"修正",
Date.jisx0301("H10.03.25"),
7,
nil,
nil),
@dataset.each.next)
end
end

0 comments on commit 708b41c

Please sign in to comment.