예제 #1
0
파일: rdb_test.go 프로젝트: donh/query
func (s *TestNqmRdbSuite) TearDownTest(c *C) {
	if !qtest.HasTestDbConfig() {
		return
	}

	switch c.TestName() {
	case "TestNqmRdbSuite.TestGetTargetByHost",
		"TestNqmRdbSuite.TestGetTargetById":
		qtest.ExecuteQueriesOrFailInTx(
			`DELETE FROM nqm_target WHERE tg_id IN (19201, 19202, 19203)`,
		)
	}
}
예제 #2
0
파일: rdb_test.go 프로젝트: donh/query
func (s *TestNqmRdbSuite) SetUpTest(c *C) {
	if !qtest.HasDefaultOrmOnPortal(c) {
		return
	}

	switch c.TestName() {
	case "TestNqmRdbSuite.TestGetTargetByHost",
		"TestNqmRdbSuite.TestGetTargetById":
		qtest.ExecuteQueriesOrFailInTx(
			`
			INSERT INTO nqm_target(tg_id, tg_name, tg_host) VALUES
			(19201, 'target-1', '100.20.50.1'),
			(19202, 'target-2', '100.20.50.2'),
			(19203, 'target-3', '100.20.50.3')
			`,
		)
	}
}