def test_options(self): _command = json.loads( "{\"k.message\":\"Bad credentials\",\"documentation_url\":\"https://developer.github.com/v3\"}" ) tbl_prop = TableProperties(database="default", table="table", webhcat=WebHCatalog(username="******")) tbl_prop._TableProperties__get = MagicMock(return_value=_command) self.assertEquals(tbl_prop._options(section="k"), ["message"])
def test_set(self): _command = json.loads( "{\"k.message\":\"Bad credentials\",\"documentation_url\":\"https://developer.github.com/v3\"}" ) tbl_prop = TableProperties(database="default", table="table", webhcat=WebHCatalog(username="******")) tbl_prop._TableProperties__get = MagicMock(return_value=_command) tbl_prop._set(section="mys", key="myk", value="myv") self.assertTrue(tbl_prop._has_option("mys", "myk"))
def test_get(self): _command = json.loads('{"k.message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}') tbl_prop = TableProperties(database="default", table="table", webhcat=WebHCatalog(username="******")) tbl_prop._TableProperties__get = MagicMock(return_value=_command) self.assertEquals(tbl_prop._get(section="k", key="message"), "Bad credentials")