Lines Matching refs:cfg
46 import pkg.config as cfg
72 self.assertRaises(cfg.InvalidPropertyValueError,
76 p = cfg.PropBool(propname)
77 self.assertRaises(cfg.InvalidPropertyValueError,
138 propcls = cfg.Property
145 self.assertRaises(cfg.InvalidPropertyNameError,
232 propcls = cfg.PropBool
273 propcls = cfg.PropDefined
293 self.assertRaises(cfg.InvalidPropertyValueError,
300 propcls = cfg.PropInt
330 self.assertRaises(cfg.InvalidPropertyValueError,
338 self.assertRaises(cfg.InvalidPropertyValueError,
345 self.assertRaises(cfg.InvalidPropertyValueError,
347 self.assertRaises(cfg.InvalidPropertyValueError,
354 self.assertRaises(cfg.InvalidPropertyValueError,
356 self.assertRaises(cfg.InvalidPropertyValueError,
369 for excls in (cfg.PropertyConfigError,
370 cfg.PropertyMultiValueError,
371 cfg.InvalidPropertyValueError, cfg.UnknownPropertyError,
372 cfg.UnknownPropertyValueError, cfg.UnknownSectionError):
392 if excls == cfg.PropertyConfigError:
397 if excls != cfg.UnknownPropertyValueError:
407 for excls in (cfg.InvalidSectionNameError,
408 cfg.InvalidSectionTemplateNameError):
421 for excls in (cfg.InvalidPropertyNameError,
422 cfg.InvalidPropertyTemplateNameError):
439 propcls = cfg.PropList
511 self.assertRaises(cfg.InvalidPropertyValueError,
514 self.assertRaises(cfg.InvalidPropertyValueError,
542 propcls = cfg.PropPublisher
578 propcls = cfg.PropSimpleList
633 propcls = cfg.PropPubURI
672 propcls = cfg.PropPubURIList
716 propcls = cfg.PropSimplePubURIList
761 propcls = cfg.PropUUID
808 propcls = cfg.PropertyTemplate
812 self.assertRaises(cfg.InvalidPropertyTemplateNameError,
821 proptemp = cfg.PropertyTemplate("^facet\..*$")
834 ({ "prop_type": cfg.Property, "value_map": { "None": None }
836 ({ "default": True, "prop_type": cfg.PropBool},
839 "prop_type": cfg.PropDefined },
843 proptemp = cfg.PropertyTemplate("name", **args)
844 extype = args.get("prop_type", cfg.Property)
872 seccls = cfg.PropertySection
880 self.assertRaises(cfg.InvalidSectionNameError,
919 propcls = cfg.Property
920 sec = cfg.PropertySection("section")
924 self.assertRaises(cfg.UnknownPropertyError,
929 self.assertRaises(cfg.UnknownPropertyError,
969 seccls = cfg.PropertySectionTemplate
973 self.assertRaises(cfg.InvalidSectionTemplateNameError,
982 sectemp = cfg.PropertySectionTemplate("^authority_.*$")
994 cfg.Property("prop"),
995 cfg.PropBool("bool"),
996 cfg.PropList("list"),
997 cfg.PropertyTemplate("multi_value", prop_type=cfg.PropList),
999 sectemp = cfg.PropertySectionTemplate("name",
1002 self.assertTrue(isinstance(sec, cfg.PropertySection))
1016 0: [cfg.PropertySection("first_section", properties=[
1017 cfg.PropBool("bool_basic"),
1018 cfg.PropBool("bool_default", default=True),
1019 cfg.PropInt("int_basic"),
1020 cfg.PropInt("int_default", default=14400),
1021 cfg.PropPublisher("publisher_basic"),
1022 cfg.PropPublisher("publisher_default",
1024 cfg.Property("str_basic"),
1025 cfg.Property("str_escape", default=";, &, (, ), |, ^, <, "
1027 cfg.Property("str_default", default=TH_PACKAGE),
1028 cfg.PropDefined("str_allowed", allowed=["<pathname>",
1031 cfg.PropDefined("str_noneallowed", allowed=["", "bob cat"]),
1032 cfg.PropList("list_basic"),
1033 cfg.PropList("list_default", default=[TH_PACKAGE, "bob cat",
1035 cfg.PropList("list_allowed", allowed=["<pathname>",
1037 cfg.PropList("list_noneallowed", allowed=["", "always",
1040 cfg.PropertySection("second_section", properties=[
1041 cfg.PropSimpleList("simple_list_basic"),
1042 cfg.PropSimpleList("simple_list_default", default=["bar",
1044 cfg.PropSimpleList("simple_list_allowed",
1047 cfg.PropSimpleList("simple_list_noneallowed",
1049 cfg.PropPubURI("uri_basic"),
1050 cfg.PropPubURI("uri_default",
1052 cfg.PropSimplePubURIList("urilist_basic"),
1053 cfg.PropSimplePubURIList("urilist_default",
1055 cfg.PropUUID("uuid_basic"),
1056 cfg.PropUUID("uuid_default",
1060 1: [cfg.PropertySection("first_section", properties=[
1061 cfg.PropBool("bool_basic"),
1062 cfg.Property("str_basic"),
1068 0: [cfg.PropertySection("facet", properties=[
1069 cfg.PropertyTemplate("^facet\..*", prop_type=cfg.PropBool)
1072 1: [cfg.PropertySectionTemplate("^authority_.*", properties=[
1073 cfg.PropPublisher("prefix")
1229 conf = cfg.Config()
1238 conf = cfg.Config()
1243 conf = cfg.Config(version=1)
1253 conf = cfg.Config(overrides=overrides)
1259 conf = cfg.Config(definitions=self._defs)
1263 conf = cfg.Config(definitions=self._defs, version=0)
1277 conf = cfg.Config(definitions=self._defs, overrides=overrides,
1292 conf = cfg.Config(definitions=self._defs, version=1)
1320 conf = cfg.Config(definitions=self._defs, version=1)
1344 propcls = cfg.Property
1345 conf = cfg.Config()
1349 self.assertRaises(cfg.UnknownSectionError, conf.get_section,
1354 self.assertRaises(cfg.UnknownSectionError, conf.remove_section,
1358 seccls = cfg.PropertySection
1418 conf = cfg.FileConfig(scpath, definitions=self._defs)
1438 conf = cfg.FileConfig(scpath, definitions=self._defs)
1454 conf = cfg.FileConfig(scpath, definitions=self._defs)
1467 conf = cfg.FileConfig(scpath, definitions=self._defs)
1481 conf = cfg.FileConfig(scpath, definitions=self._defs, version=0)
1498 conf = cfg.FileConfig(scpath, definitions=self._defs)
1511 conf = cfg.FileConfig(scpath, definitions=self._defs)
1523 conf = cfg.FileConfig(scpath, definitions=self._defs,
1531 conf = cfg.FileConfig(scpath, definitions=self._defs,
1563 conf = cfg.Config()
1566 self.assertRaises(cfg.UnknownSectionError,
1568 self.assertRaises(cfg.UnknownPropertyError,
1577 self.assertTrue(isinstance(secobj, cfg.PropertySection))
1608 self.assertRaises(cfg.UnknownPropertyError,
1612 conf = cfg.Config(definitions=self._defs, version=0)
1623 self.assertRaises(cfg.InvalidPropertyValueError,
1629 conf = cfg.Config(definitions=self._defs, version=0)
1637 self.assertRaises(cfg.InvalidPropertyValueError,
1641 self.assertRaises(cfg.InvalidPropertyValueError,
1650 self.assertRaises(cfg.PropertyMultiValueError,
1653 self.assertRaises(cfg.PropertyMultiValueError,
1671 self.assertRaises(cfg.UnknownPropertyValueError,
1680 self.assertRaises(cfg.UnknownPropertyError,
1692 self.assertRaises(cfg.InvalidPropertyValueError,
1699 self.assertRaises(cfg.UnknownPropertyError,
1704 self.assertRaises(cfg.UnknownPropertyError,
1711 conf = cfg.Config(definitions=self._templated_defs, version=0)
1717 conf = cfg.Config(definitions=self._templated_defs, version=1)
1879 3: [cfg.PropertySection("escaped", properties=[
1880 cfg.Property("one_slash", default="\\"),
1881 cfg.Property("two_slash", default="\\\\"),
1882 cfg.Property("one_slash_embed", default="\\\n\\"),
1883 cfg.Property("two_slash_embed", default="\\\\\n\\\\"),
1884 cfg.Property("end_embed_one_slash", default="foo\\\n\\"),
1885 cfg.Property("end_one_slash", default="foo\\"),
1886 cfg.Property("end_two_slash", default="foo\\\\"),
1887 cfg.Property("end_embed_two_slash", default="foo\\\\\n\\\\"),
1888 cfg.Property("multi_line", default="foo\\\n\n\\\n\n\\\n\\"),
1889 cfg.PropList("list_multi_line", default=[
2005 for excls in (cfg.SMFReadError, cfg.SMFWriteError):
2022 excls = cfg.SMFInvalidSectionNameError
2035 excls = cfg.SMFInvalidPropertyNameError
2066 conf = cfg.SMFConfig(svc_fmri,
2081 section = cfg.PropertySection(sname)
2082 self.assertRaises(cfg.SMFInvalidSectionNameError,
2089 self.assertRaises(cfg.SMFInvalidPropertyNameError,
2119 conf = cfg.SMFConfig(svc_fmri,
2133 self.assertRaises(cfg.SMFWriteError, conf.write)
2150 self.assertRaises(cfg.SMFReadError, test_mfst,