19
19
import time
20
20
import unittest
21
21
import warnings
22
- import subprocess
23
22
24
23
# By default, raise exceptions on warnings
25
24
warnings .simplefilter ('error' , FutureWarning )
30
29
from influxdb .tests import skipIfPYpy , using_pypy , skipServerTests
31
30
from influxdb .tests .server_tests .base import ManyTestCasesWithServerMixin
32
31
from influxdb .tests .server_tests .base import SingleTestCaseWithServerMixin
33
- from influxdb .tests .misc import find_influxd_path
34
32
35
33
if not using_pypy :
36
34
import pandas as pd
37
35
from pandas .util .testing import assert_frame_equal
38
36
39
37
40
38
THIS_DIR = os .path .abspath (os .path .dirname (__file__ ))
41
- INFLUXDB_BIN_PATH = find_influxd_path ()
42
- INFLUXDB_VERSION = (subprocess .check_output ([INFLUXDB_BIN_PATH , 'version' ])
43
- .split ()[1 ])
44
-
45
- # Version-specific differences between 0.9 and 0.13
46
- if (INFLUXDB_VERSION .split (b'.' )[:2 ] == [b'v0' , b'13' ]):
47
- rp_duration = '0s'
48
- elif (INFLUXDB_VERSION .split (b'.' )[:2 ] == [b'v0' , b'9' ]):
49
- rp_duration = '0'
50
39
51
40
52
41
def point (serie_name , timestamp = None , tags = None , ** fields ):
@@ -458,7 +447,7 @@ def test_default_retention_policy(self):
458
447
self .assertEqual (
459
448
[
460
449
{'name' : 'default' ,
461
- 'duration' : rp_duration ,
450
+ 'duration' : '0' ,
462
451
'replicaN' : 1 ,
463
452
'shardGroupDuration' : u'168h0m0s' ,
464
453
'default' : True }
@@ -473,7 +462,7 @@ def test_create_retention_policy_default(self):
473
462
474
463
self .assertEqual (
475
464
[
476
- {'duration' : rp_duration ,
465
+ {'duration' : '0' ,
477
466
'default' : False ,
478
467
'replicaN' : 1 ,
479
468
'shardGroupDuration' : u'168h0m0s' ,
@@ -497,7 +486,7 @@ def test_create_retention_policy(self):
497
486
rsp = self .cli .get_list_retention_policies ()
498
487
self .assertEqual (
499
488
[
500
- {'duration' : rp_duration ,
489
+ {'duration' : '0' ,
501
490
'default' : True ,
502
491
'replicaN' : 1 ,
503
492
'shardGroupDuration' : u'168h0m0s' ,
@@ -520,7 +509,7 @@ def test_alter_retention_policy(self):
520
509
rsp = self .cli .get_list_retention_policies ()
521
510
self .assertEqual (
522
511
[
523
- {'duration' : rp_duration ,
512
+ {'duration' : '0' ,
524
513
'default' : True ,
525
514
'replicaN' : 1 ,
526
515
'shardGroupDuration' : u'168h0m0s' ,
@@ -540,7 +529,7 @@ def test_alter_retention_policy(self):
540
529
rsp = self .cli .get_list_retention_policies ()
541
530
self .assertEqual (
542
531
[
543
- {'duration' : rp_duration ,
532
+ {'duration' : '0' ,
544
533
'default' : True ,
545
534
'replicaN' : 1 ,
546
535
'shardGroupDuration' : u'168h0m0s' ,
@@ -560,7 +549,7 @@ def test_alter_retention_policy(self):
560
549
rsp = self .cli .get_list_retention_policies ()
561
550
self .assertEqual (
562
551
[
563
- {'duration' : rp_duration ,
552
+ {'duration' : '0' ,
564
553
'default' : False ,
565
554
'replicaN' : 1 ,
566
555
'shardGroupDuration' : u'168h0m0s' ,
@@ -584,7 +573,7 @@ def test_alter_retention_policy_invalid(self):
584
573
rsp = self .cli .get_list_retention_policies ()
585
574
self .assertEqual (
586
575
[
587
- {'duration' : rp_duration ,
576
+ {'duration' : '0' ,
588
577
'default' : True ,
589
578
'replicaN' : 1 ,
590
579
'shardGroupDuration' : u'168h0m0s' ,
@@ -606,7 +595,7 @@ def test_drop_retention_policy(self):
606
595
rsp = self .cli .get_list_retention_policies ()
607
596
self .assertEqual (
608
597
[
609
- {'duration' : rp_duration ,
598
+ {'duration' : '0' ,
610
599
'default' : True ,
611
600
'replicaN' : 1 ,
612
601
'shardGroupDuration' : u'168h0m0s' ,
0 commit comments