Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wuan/bo-python
Browse files Browse the repository at this point in the history
  • Loading branch information
wuan committed Aug 14, 2016
2 parents d521ae5 + 9791344 commit 280fce3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions debian/changelog
@@ -1,6 +1,7 @@
python-blitzortung (1.5.0) unstable; urgency=low

* use python properties instead of getters (this will break compatibility to earlier versions)
* speed improvements

-- Andreas Wuerl <blitzortung@tryb.de> Sun, 09 Aug 2015 10:36:12 +0200

Expand Down
12 changes: 12 additions & 0 deletions tests/test_builder.py
Expand Up @@ -73,6 +73,18 @@ def test_set_timestamp_from_pandas_timestamp_with_ns_offset(self):
assert_that(timestamp.tzinfo, is_(equal_to(pytz.timezone('CET'))))
assert_that(timestamp.nanosecond, is_(equal_to(423)))

def test_value_property(self):
timestamp = self.builder.set_timestamp(datetime.datetime(2012, 2, 10, 12, 56, 18, 96651)).build()

value = timestamp.value
assert_that(value, is_(equal_to(1328878578096651000)))

def test_value_property_with_nanoseconds(self):
timestamp = self.builder.set_timestamp(datetime.datetime(2012, 2, 10, 12, 56, 18, 96651), 456).build()

value = timestamp.value
assert_that(value, is_(equal_to(1328878578096651456)))

def test_set_timestamp_from_bad_string(self):
timestamp = self.builder.set_timestamp('0000-00-00').build()
assert_that(timestamp.value, is_(pd.NaT.value))
Expand Down

0 comments on commit 280fce3

Please sign in to comment.