Skip to content

Commit

Permalink
Use smaller testdata files (#1283)
Browse files Browse the repository at this point in the history
### Changelog
None

### Docs
None

### Description
Use smaller and simpler `demo.bag` and `demo.mcap` files.

Fixes: FG-9552
  • Loading branch information
sofuture authored Dec 2, 2024
1 parent 624f2b6 commit 6631fbc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions go/mcap/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func TestReaderCounting(t *testing.T) {
require.NoError(t, err)
c++
}
assert.Equal(t, 1606, c)
assert.Equal(t, 3, c)
})
}
}
Expand Down Expand Up @@ -673,7 +673,7 @@ func TestReadingDiagnostics(t *testing.T) {
require.NoError(t, err)
c++
}
assert.Equal(t, 52, c)
assert.Equal(t, 1, c)
}

func TestReadingMetadata(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions python/mcap/tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_all_messages(reader_cls: AnyReaderSubclass):
assert isinstance(message, Message)
count += 1

assert count == 1606
assert count == 3


@pytest.mark.parametrize("reader_cls", READER_SUBCLASSES)
Expand All @@ -76,8 +76,8 @@ def test_time_range(reader_cls: AnyReaderSubclass):
with open(DEMO_MCAP, "rb") as f:
reader: McapReader = reader_cls(f)
count = 0
start = int(1490149582 * 1e9)
end = int(1490149586 * 1e9)
start = int(40)
end = int(43)
for schema, channel, message in reader.iter_messages(
start_time=start, end_time=end
):
Expand All @@ -88,7 +88,7 @@ def test_time_range(reader_cls: AnyReaderSubclass):
assert message.log_time >= start
count += 1

assert count == 825
assert count == 1


@pytest.mark.parametrize("reader_cls", READER_SUBCLASSES)
Expand All @@ -104,7 +104,7 @@ def test_only_diagnostics(reader_cls: AnyReaderSubclass):
assert isinstance(message, Message)
count += 1

assert count == 52
assert count == 1


def write_json_mcap(filepath: Path):
Expand Down
4 changes: 2 additions & 2 deletions testdata/bags/demo.bag
Git LFS file not shown
4 changes: 2 additions & 2 deletions testdata/mcap/demo.mcap
Git LFS file not shown

0 comments on commit 6631fbc

Please sign in to comment.