Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71a72e4

Browse files
committed
Change url assert in test_package
1 parent 522c0d5 commit 71a72e4

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ VERSION := `git describe --tags --dirty 2>/dev/null`
1515
COMMITHASH := `git rev-parse --short HEAD 2>/dev/null`
1616
DATE := `date "+%FT%T%z"`
1717

18+
CONTAINER_NAME := 'splunk'
19+
1820
.PHONY: all
1921
all: build_app test
2022

@@ -56,3 +58,37 @@ splunkrc:
5658
@echo "$(ATTN_COLOR)==> splunkrc $(NO_COLOR)"
5759
@echo "To make a .splunkrc:"
5860
@echo " [SPLUNK_INSTANCE_JSON] | python scripts/build-splunkrc.py ~/.splunkrc"
61+
62+
.PHONY: splunkrc_default
63+
splunkrc_default:
64+
@echo "$(ATTN_COLOR)==> splunkrc_default $(NO_COLOR)"
65+
@python scripts/build-splunkrc.py ~/.splunkrc
66+
67+
.PHONY: up
68+
up:
69+
@echo "$(ATTN_COLOR)==> up $(NO_COLOR)"
70+
@docker-compose up -d
71+
72+
.PHONY: remove
73+
remove:
74+
@echo "$(ATTN_COLOR)==> rm $(NO_COLOR)"
75+
@docker-compose rm -f -s
76+
77+
.PHONY: wait_up
78+
wait_up:
79+
@echo "$(ATTN_COLOR)==> wait_up $(NO_COLOR)"
80+
@for i in `seq 0 180`; do if docker exec -it $(CONTAINER_NAME) /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done
81+
82+
.PHONY: down
83+
down:
84+
@echo "$(ATTN_COLOR)==> down $(NO_COLOR)"
85+
@docker-compose stop
86+
87+
.PHONY: start
88+
start: up wait_up
89+
90+
.PHONY: restart
91+
restart: down start
92+
93+
.PHONY: refresh
94+
refresh: remove start

tests/test_app.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,9 @@ def test_delete(self):
9595
def test_package(self):
9696
p = self.app.package()
9797
self.assertEqual(p.name, self.app_name)
98-
print(self.app_name)
99-
print(p.url)
10098
self.assertTrue(p.path.endswith(self.app_name + '.spl'))
101-
self.assertTrue(p.url.endswith(self.app_name + '.spl'))
99+
# Assert string due to deprecation of this property in new Splunk versions
100+
self.assertIsInstance(p.url, str)
102101

103102
def test_updateInfo(self):
104103
p = self.app.updateInfo()

0 commit comments

Comments
 (0)