Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(17)  |  Call(12)  |  Derive(0)  |  Import(5)

src/t/e/tempodb-python-HEAD/tempodb/client.py   tempodb-python(Download)
 
import tempodb
from tempodb import DataPoint, DataSet, DeleteSummary, Series, Summary
 
 

src/t/e/tempodb-0.5.0/tempodb/client.py   tempodb(Download)
 
import tempodb
from tempodb import DataPoint, DataSet, DeleteSummary, Series, Summary
 
 

src/t/e/tempodb-python-HEAD/tests/client/tests.py   tempodb-python(Download)
 
import tempodb
from tempodb import Client, DataPoint, DataSet, Series, Summary
 
 
            headers=self.get_headers
        )
        expected = [Series('id', 'key', 'name', {'key1': 'value1'}, ['tag1', 'tag2'])]
        self.assertEqual(series, expected)
 
            headers=self.post_headers
        )
        expected = Series('id', 'my-key.tag1.1', '', {}, ['my-key', 'tag1'])
        self.assertEqual(series, expected)
 
    def test_update_series(self):
        update = Series('id', 'key', 'name', {'key1': 'value1'}, ['tag1'])
        self.client.session.put.return_value = MockResponse(200, simplejson.dumps(update.to_json()))
 
        updated = self.client.update_series(update)
        dataset = self.client.read_id('id', start, end)
 
        expected = DataSet(Series('id', 'key'), start, end, [DataPoint(start, 12.34)], Summary())
        self.client.session.get.assert_called_once_with(
            'https://example.com/v1/series/id/id/data/?start=2012-03-27T00%3A00%3A00&end=2012-03-28T00%3A00%3A00',

src/t/e/tempodb-python-HEAD/tests/base/dataset_tests.py   tempodb-python(Download)
from unittest2 import TestCase
 
from tempodb import DataPoint, DataSet, Series, Summary
 
 
    def test_init(self):
        start = datetime.datetime(2012, 1, 1)
        end = datetime.datetime(2012, 1, 2)
        series = Series("id", "key")
        data = [DataPoint(start, 12.34), DataPoint(end, 23.45)]
        }
        dataset = DataSet.from_json(json)
        series = Series('id', 'key', 'name', {'key1': 'value1'}, ['tag1', 'tag2'])
        start = datetime.datetime(2012, 3, 27)
        end = datetime.datetime(2012, 3, 28)

src/t/e/tempodb-python-HEAD/tests/base/series_tests.py   tempodb-python(Download)
from unittest2 import TestCase
 
from tempodb import Series
 
 
class SeriesTest(TestCase):
 
    def test_init(self):
        series = Series('id', 'key', 'name', {'key1': 'value1'}, ['tag1', 'tag2'])
    def test_to_json(self):
        series = Series('id', 'key', 'name', {'key1': 'value1'}, ['tag1', 'tag2'])
        json = series.to_json()
        expected = {
            'id': 'id',
        }
        series = Series.from_json(json)
        expected = Series('id', 'key', 'name', {'key1': 'value1'}, ['tag1', 'tag2'])
        self.assertEqual(series, expected)