Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add tests for the pub and sub addr overide

  • Loading branch information...
commit c2a98e952ebb8b8e39caa83cf8c2da2b2231045b 1 parent 5fafe6d
@larubbio larubbio authored
Showing with 34 additions and 0 deletions.
  1. +33 −0 tests/base/engine_tests.lua
  2. +1 −0  tests/data/config.lua
View
33 tests/base/engine_tests.lua
@@ -0,0 +1,33 @@
+require 'tir.engine'
+
+
+function fake_main()
+ print("TEST")
+end
+
+context("Tir", function()
+ context("engine", function()
+ test("start", function()
+ Tir.run = function() return true end
+ Tir.M2.connect = function() return true end
+
+ local config = {config_file = 'tests/data/config.lua', route = '/arc'}
+ Tir.start(config)
+
+ assert_equal('tcp://127.0.0.1:9990', config.sub_addr)
+ assert_equal('tcp://127.0.0.1:9989', config.pub_addr)
+ end)
+
+ test("start-overide", function()
+ Tir.run = function() return true end
+ Tir.M2.connect = function() return true end
+
+ local config = {config_file = 'tests/data/config.lua', route = '/arc', pub_addr = 'tcp://10.234.56.71:9990', sub_addr = 'tcp://10.234.56.71:9989'}
+ Tir.start(config)
+
+ assert_equal('tcp://10.234.56.71:9990', config.pub_addr)
+ assert_equal('tcp://10.234.56.71:9989', config.sub_addr)
+ end)
+ end)
+end)
+
View
1  tests/data/config.lua
@@ -0,0 +1 @@
+config_db = 'tests/data/config.sqlite'
Please sign in to comment.
Something went wrong with that request. Please try again.