Skip to content

Commit

Permalink
[test/rangeDim] test for append_range_dim_using self
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrewe committed Jun 7, 2021
1 parent c31eef8 commit 482697b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nixio/test/test_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from nixio.exceptions.exceptions import IncompatibleDimensions
import os
import unittest
import numpy as np
Expand Down Expand Up @@ -389,6 +390,17 @@ def test_data_array_self_link_range_dimension(self):
assert da.dimensions[0].unit == da.unit
assert np.all(da.dimensions[0].ticks == da[:])
assert rdim.is_alias

da.delete_dimensions()
da.append_range_dimension_using_self()
assert len(da.dimensions) == 1
assert da.dimensions[0].is_alias

da.delete_dimensions()
self.assertRaises(da.append_range_dimension_using_self([0, -1]), IncompatibleDimensions)
da.append_range_dimension_using_self([-1])
assert len(da.dimensions) == 1
assert da.dimensions[0].is_alias

def test_data_array_self_link_set_dimension(self):
# The new way of making alias range dimension
Expand Down

0 comments on commit 482697b

Please sign in to comment.