Best Python code snippet using ATX
graph_traversal.py
Source:graph_traversal.py
...66 def withComputer(self,graph_computer=None, workers=None, result=None, persist=None, vertices=None, edges=None, configuration=None):67 return self.withStrategies(VertexProgramStrategy(graph_computer,workers,result,persist,vertices,edges,configuration))68 def E(self, *args):69 traversal = GraphTraversal(self.graph, self.traversal_strategies, Bytecode(self.bytecode))70 traversal.bytecode.add_step("E", *args)71 return traversal72 def V(self, *args):73 traversal = GraphTraversal(self.graph, self.traversal_strategies, Bytecode(self.bytecode))74 traversal.bytecode.add_step("V", *args)75 return traversal76 def addV(self, *args):77 traversal = GraphTraversal(self.graph, self.traversal_strategies, Bytecode(self.bytecode))78 traversal.bytecode.add_step("addV", *args)79 return traversal80 def inject(self, *args):81 traversal = GraphTraversal(self.graph, self.traversal_strategies, Bytecode(self.bytecode))82 traversal.bytecode.add_step("inject", *args)83 return traversal84class GraphTraversal(Traversal):85 def __init__(self, graph, traversal_strategies, bytecode):86 Traversal.__init__(self, graph, traversal_strategies, bytecode)87 def __getitem__(self, index):88 if isinstance(index, int):89 return self.range(long(index),long(index)+1)90 elif isinstance(index, slice):91 low = long(0) if index.start is None else long(index.start)92 high = long(sys.maxsize) if index.stop is None else long(index.stop)93 if low == long(0):94 return self.limit(high)95 else:96 return self.range(low,high)97 else:98 raise TypeError("Index must be an int or slice")99 def __getattr__(self, key):100 return self.values(key)101 def V(self, *args):102 self.bytecode.add_step("V", *args)103 return self104 def addE(self, *args):105 self.bytecode.add_step("addE", *args)106 return self107 def addInE(self, *args):108 self.bytecode.add_step("addInE", *args)109 return self110 def addOutE(self, *args):111 self.bytecode.add_step("addOutE", *args)112 return self113 def addV(self, *args):114 self.bytecode.add_step("addV", *args)115 return self116 def aggregate(self, *args):117 self.bytecode.add_step("aggregate", *args)118 return self119 def and_(self, *args):120 self.bytecode.add_step("and", *args)121 return self122 def as_(self, *args):123 self.bytecode.add_step("as", *args)124 return self125 def barrier(self, *args):126 self.bytecode.add_step("barrier", *args)127 return self128 def both(self, *args):129 self.bytecode.add_step("both", *args)130 return self131 def bothE(self, *args):132 self.bytecode.add_step("bothE", *args)133 return self134 def bothV(self, *args):135 self.bytecode.add_step("bothV", *args)136 return self137 def branch(self, *args):138 self.bytecode.add_step("branch", *args)139 return self140 def by(self, *args):141 self.bytecode.add_step("by", *args)142 return self143 def cap(self, *args):144 self.bytecode.add_step("cap", *args)145 return self146 def choose(self, *args):147 self.bytecode.add_step("choose", *args)148 return self149 def coalesce(self, *args):150 self.bytecode.add_step("coalesce", *args)151 return self152 def coin(self, *args):153 self.bytecode.add_step("coin", *args)154 return self155 def constant(self, *args):156 self.bytecode.add_step("constant", *args)157 return self158 def count(self, *args):159 self.bytecode.add_step("count", *args)160 return self161 def cyclicPath(self, *args):162 self.bytecode.add_step("cyclicPath", *args)163 return self164 def dedup(self, *args):165 self.bytecode.add_step("dedup", *args)166 return self167 def drop(self, *args):168 self.bytecode.add_step("drop", *args)169 return self170 def emit(self, *args):171 self.bytecode.add_step("emit", *args)172 return self173 def filter(self, *args):174 self.bytecode.add_step("filter", *args)175 return self176 def flatMap(self, *args):177 self.bytecode.add_step("flatMap", *args)178 return self179 def fold(self, *args):180 self.bytecode.add_step("fold", *args)181 return self182 def from_(self, *args):183 self.bytecode.add_step("from", *args)184 return self185 def group(self, *args):186 self.bytecode.add_step("group", *args)187 return self188 def groupCount(self, *args):189 self.bytecode.add_step("groupCount", *args)190 return self191 def groupV3d0(self, *args):192 self.bytecode.add_step("groupV3d0", *args)193 return self194 def has(self, *args):195 self.bytecode.add_step("has", *args)196 return self197 def hasId(self, *args):198 self.bytecode.add_step("hasId", *args)199 return self200 def hasKey(self, *args):201 self.bytecode.add_step("hasKey", *args)202 return self203 def hasLabel(self, *args):204 self.bytecode.add_step("hasLabel", *args)205 return self206 def hasNot(self, *args):207 self.bytecode.add_step("hasNot", *args)208 return self209 def hasValue(self, *args):210 self.bytecode.add_step("hasValue", *args)211 return self212 def id(self, *args):213 self.bytecode.add_step("id", *args)214 return self215 def identity(self, *args):216 self.bytecode.add_step("identity", *args)217 return self218 def inE(self, *args):219 self.bytecode.add_step("inE", *args)220 return self221 def inV(self, *args):222 self.bytecode.add_step("inV", *args)223 return self224 def in_(self, *args):225 self.bytecode.add_step("in", *args)226 return self227 def inject(self, *args):228 self.bytecode.add_step("inject", *args)229 return self230 def is_(self, *args):231 self.bytecode.add_step("is", *args)232 return self233 def key(self, *args):234 self.bytecode.add_step("key", *args)235 return self236 def label(self, *args):237 self.bytecode.add_step("label", *args)238 return self239 def limit(self, *args):240 self.bytecode.add_step("limit", *args)241 return self242 def local(self, *args):243 self.bytecode.add_step("local", *args)244 return self245 def loops(self, *args):246 self.bytecode.add_step("loops", *args)247 return self248 def map(self, *args):249 self.bytecode.add_step("map", *args)250 return self251 def mapKeys(self, *args):252 self.bytecode.add_step("mapKeys", *args)253 return self254 def mapValues(self, *args):255 self.bytecode.add_step("mapValues", *args)256 return self257 def match(self, *args):258 self.bytecode.add_step("match", *args)259 return self260 def max(self, *args):261 self.bytecode.add_step("max", *args)262 return self263 def mean(self, *args):264 self.bytecode.add_step("mean", *args)265 return self266 def min(self, *args):267 self.bytecode.add_step("min", *args)268 return self269 def not_(self, *args):270 self.bytecode.add_step("not", *args)271 return self272 def option(self, *args):273 self.bytecode.add_step("option", *args)274 return self275 def optional(self, *args):276 self.bytecode.add_step("optional", *args)277 return self278 def or_(self, *args):279 self.bytecode.add_step("or", *args)280 return self281 def order(self, *args):282 self.bytecode.add_step("order", *args)283 return self284 def otherV(self, *args):285 self.bytecode.add_step("otherV", *args)286 return self287 def out(self, *args):288 self.bytecode.add_step("out", *args)289 return self290 def outE(self, *args):291 self.bytecode.add_step("outE", *args)292 return self293 def outV(self, *args):294 self.bytecode.add_step("outV", *args)295 return self296 def pageRank(self, *args):297 self.bytecode.add_step("pageRank", *args)298 return self299 def path(self, *args):300 self.bytecode.add_step("path", *args)301 return self302 def peerPressure(self, *args):303 self.bytecode.add_step("peerPressure", *args)304 return self305 def profile(self, *args):306 self.bytecode.add_step("profile", *args)307 return self308 def program(self, *args):309 self.bytecode.add_step("program", *args)310 return self311 def project(self, *args):312 self.bytecode.add_step("project", *args)313 return self314 def properties(self, *args):315 self.bytecode.add_step("properties", *args)316 return self317 def property(self, *args):318 self.bytecode.add_step("property", *args)319 return self320 def propertyMap(self, *args):321 self.bytecode.add_step("propertyMap", *args)322 return self323 def range(self, *args):324 self.bytecode.add_step("range", *args)325 return self326 def repeat(self, *args):327 self.bytecode.add_step("repeat", *args)328 return self329 def sack(self, *args):330 self.bytecode.add_step("sack", *args)331 return self332 def sample(self, *args):333 self.bytecode.add_step("sample", *args)334 return self335 def select(self, *args):336 self.bytecode.add_step("select", *args)337 return self338 def selectV3d2(self, *args):339 self.bytecode.add_step("selectV3d2", *args)340 return self341 def sideEffect(self, *args):342 self.bytecode.add_step("sideEffect", *args)343 return self344 def simplePath(self, *args):345 self.bytecode.add_step("simplePath", *args)346 return self347 def store(self, *args):348 self.bytecode.add_step("store", *args)349 return self350 def subgraph(self, *args):351 self.bytecode.add_step("subgraph", *args)352 return self353 def sum(self, *args):354 self.bytecode.add_step("sum", *args)355 return self356 def tail(self, *args):357 self.bytecode.add_step("tail", *args)358 return self359 def timeLimit(self, *args):360 self.bytecode.add_step("timeLimit", *args)361 return self362 def times(self, *args):363 self.bytecode.add_step("times", *args)364 return self365 def to(self, *args):366 self.bytecode.add_step("to", *args)367 return self368 def toE(self, *args):369 self.bytecode.add_step("toE", *args)370 return self371 def toV(self, *args):372 self.bytecode.add_step("toV", *args)373 return self374 def tree(self, *args):375 self.bytecode.add_step("tree", *args)376 return self377 def unfold(self, *args):378 self.bytecode.add_step("unfold", *args)379 return self380 def union(self, *args):381 self.bytecode.add_step("union", *args)382 return self383 def until(self, *args):384 self.bytecode.add_step("until", *args)385 return self386 def value(self, *args):387 self.bytecode.add_step("value", *args)388 return self389 def valueMap(self, *args):390 self.bytecode.add_step("valueMap", *args)391 return self392 def values(self, *args):393 self.bytecode.add_step("values", *args)394 return self395 def where(self, *args):396 self.bytecode.add_step("where", *args)397 return self398class __(object):399 @staticmethod400 def start():401 return GraphTraversal(None, None, Bytecode())402 @staticmethod403 def __(*args):404 return __.inject(*args)405 @staticmethod406 def V(*args):407 return GraphTraversal(None, None, Bytecode()).V(*args)408 @staticmethod409 def addE(*args):410 return GraphTraversal(None, None, Bytecode()).addE(*args)...
NotificationTest.py
Source:NotificationTest.py
...111 tester = SysrepoTester("Tester", sr.SR_DS_RUNNING)112 subscriber = NotificationTester("Subscriber")113 subscriber2 = NotificationTester("Subscriber2")114 subscriber3 = NotificationTester("Subscriber3")115 tester.add_step(tester.waitStep)116 subscriber.add_step(subscriber.subscribeStep,117 "ietf-interfaces", "/ietf-interfaces:interfaces")118 subscriber2.add_step(subscriber2.waitStep)119 subscriber3.add_step(subscriber3.subscribeStep,120 "example-module", "/example-module:container")121 tester.add_step(tester.waitStep)122 subscriber.add_step(subscriber.waitStep)123 subscriber2.add_step(subscriber2.subscribeStep,124 "ietf-interfaces", "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/address")125 subscriber3.add_step(subscriber3.waitStep)126 tester.add_step(tester.deleteItemStep, "/ietf-interfaces:interfaces/interface[name='eth0']")127 subscriber.add_step(subscriber.waitStep)128 subscriber2.add_step(subscriber2.waitStep)129 subscriber3.add_step(subscriber3.waitStep)130 tester.add_step(tester.commitStep)131 subscriber.add_step(subscriber.waitStep)132 subscriber2.add_step(subscriber2.waitStep)133 subscriber3.add_step(subscriber3.waitStep)134 tester.add_step(tester.waitStep)135 subscriber.add_step(subscriber.checkNotificationStep,136 [["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']"],137 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/name"],138 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/type"],139 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/enabled"],140 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/description"],141 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4"],142 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']"],143 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']/ip"],144 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']/prefix-length"],145 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/mtu"],146 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled"],147 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/forwarding"]])148 subscriber2.add_step(subscriber2.checkNotificationStep,149 [["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']"],150 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']/ip"],151 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']/prefix-length"],152 ])153 subscriber3.add_step(subscriber3.checkNoNotificationArrived)154 tester.add_step(tester.waitStep)155 subscriber.add_step(subscriber.cancelSubscriptionStep)156 subscriber2.add_step(subscriber2.cancelSubscriptionStep)157 subscriber3.add_step(subscriber3.cancelSubscriptionStep)158 tester.add_step(tester.stopSession)159 subscriber.add_step(subscriber.stopSession)160 subscriber2.add_step(subscriber2.stopSession)161 subscriber3.add_step(subscriber3.stopSession)162 tester.add_step(tester.disconnect)163 subscriber.add_step(subscriber.disconnect)164 subscriber2.add_step(subscriber2.disconnect)165 subscriber3.add_step(subscriber3.disconnect)166 tm.add_tester(tester)167 tm.add_tester(subscriber)168 tm.add_tester(subscriber2)169 tm.add_tester(subscriber3)170 tm.run()171 def test_notify_modify(self):172 tm = TestManager()173 tester = SysrepoTester("Tester", sr.SR_DS_RUNNING, False)174 subscriber = NotificationTester("Subscriber")175 subscriber2 = NotificationTester("Subscriber2")176 subscriber3 = NotificationTester("Subscriber3")177 tester.add_step(tester.waitStep)178 subscriber.add_step(subscriber.subscribeStep, "ietf-interfaces",179 "/ietf-interfaces:interfaces")180 subscriber2.add_step(subscriber2.waitStep)181 subscriber3.add_step(subscriber3.subscribeStep, "example-module",182 "/example-module:container")183 tester.add_step(tester.waitStep)184 subscriber.add_step(subscriber.waitStep)185 subscriber2.add_step(subscriber2.subscribeStep, "ietf-interfaces",186 "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4")187 subscriber3.add_step(subscriber3.waitStep)188 tester.add_step(189 tester.setItemStep, "/ietf-interfaces:interfaces/interface[name='eth0']/type", sr.Val("iana-if-type:ethernetCsmacd", sr.SR_IDENTITYREF_T))190 subscriber.add_step(subscriber.waitStep)191 subscriber2.add_step(subscriber2.waitStep)192 subscriber3.add_step(subscriber3.waitStep)193 tester.add_step(194 tester.setItemStep, "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled", sr.Val(False, sr.SR_BOOL_T))195 subscriber.add_step(subscriber.waitStep)196 subscriber2.add_step(subscriber2.waitStep)197 subscriber3.add_step(subscriber3.waitStep)198 tester.add_step(tester.commitStep)199 subscriber.add_step(subscriber.waitStep)200 subscriber2.add_step(subscriber2.waitStep)201 subscriber3.add_step(subscriber3.waitStep)202 tester.add_step(tester.waitStep)203 subscriber.add_step(subscriber.checkNotificationStep,204 [["MODIFIED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled"]])205 subscriber2.add_step(subscriber2.checkNotificationStep,206 [["MODIFIED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled"]])207 subscriber3.add_step(subscriber3.checkNoNotificationArrived)208 tester.add_step(tester.waitStep)209 subscriber.add_step(subscriber.cancelSubscriptionStep)210 subscriber2.add_step(subscriber2.cancelSubscriptionStep)211 subscriber3.add_step(subscriber3.cancelSubscriptionStep)212 tester.add_step(tester.stopSession)213 subscriber.add_step(subscriber.stopSession)214 subscriber2.add_step(subscriber2.stopSession)215 subscriber3.add_step(subscriber3.stopSession)216 tester.add_step(tester.disconnect)217 subscriber.add_step(subscriber.disconnect)218 subscriber2.add_step(subscriber2.disconnect)219 subscriber3.add_step(subscriber3.disconnect)220 tm.add_tester(tester)221 tm.add_tester(subscriber)222 tm.add_tester(subscriber2)223 tm.add_tester(subscriber3)224 tm.run()225 def test_notify_changes_in_multiple_modules(self):226 tm = TestManager()227 tester = SysrepoTester("Tester", sr.SR_DS_RUNNING, False)228 subscriber = NotificationTester("Subscriber")229 subscriber2 = NotificationTester("Subscriber2")230 subscriber3 = NotificationTester("Subscriber3")231 tester.add_step(tester.waitStep)232 subscriber.add_step(subscriber.subscribeStep, "ietf-interfaces",233 "/ietf-interfaces:interfaces")234 subscriber2.add_step(subscriber2.waitStep)235 subscriber3.add_step(subscriber3.subscribeStep, "example-module",236 "/example-module:container")237 tester.add_step(tester.waitStep)238 subscriber.add_step(subscriber.waitStep)239 subscriber2.add_step(subscriber2.subscribeStep, "ietf-interfaces",240 "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/address")241 subscriber3.add_step(subscriber3.waitStep)242 tester.add_step(243 tester.setItemStep, "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled", sr.Val(False, sr.SR_BOOL_T))244 subscriber.add_step(subscriber.waitStep)245 subscriber2.add_step(subscriber2.waitStep)246 subscriber3.add_step(subscriber3.waitStep)247 tester.add_step(248 tester.setItemStep, "/example-module:container/list[key1='abc'][key2='def']/leaf", sr.Val("new value", sr.SR_STRING_T))249 subscriber.add_step(subscriber.waitStep)250 subscriber2.add_step(subscriber2.waitStep)251 subscriber3.add_step(subscriber3.waitStep)252 tester.add_step(tester.commitStep)253 subscriber.add_step(subscriber.waitStep)254 subscriber2.add_step(subscriber2.waitStep)255 subscriber3.add_step(subscriber3.waitStep)256 tester.add_step(tester.deleteItemStep,257 "/example-module:container/list[key1='key1'][key2='key2']/leaf")258 subscriber.add_step(subscriber.waitStep)259 subscriber2.add_step(subscriber2.waitStep)260 subscriber3.add_step(subscriber3.waitStep)261 tester.add_step(tester.commitStep)262 subscriber.add_step(subscriber.waitStep)263 subscriber2.add_step(subscriber2.waitStep)264 subscriber3.add_step(subscriber3.waitStep)265 tester.add_step(tester.waitStep)266 subscriber.add_step(subscriber.checkNotificationStep,267 [["MODIFIED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled"]])268 subscriber2.add_step(subscriber2.checkNoNotificationArrived)269 subscriber3.add_step(subscriber3.checkNotificationStep, [270 ["DELETED", "/example-module:container/list[key1='key1'][key2='key2']/leaf"],271 ["CREATED", "/example-module:container/list[key1='abc'][key2='def']"],272 ["CREATED", "/example-module:container/list[key1='abc'][key2='def']/key1"],273 ["CREATED", "/example-module:container/list[key1='abc'][key2='def']/key2"],274 ["CREATED", "/example-module:container/list[key1='abc'][key2='def']/leaf"]275 ])276 tester.add_step(tester.waitStep)277 subscriber.add_step(subscriber.cancelSubscriptionStep)278 subscriber2.add_step(subscriber2.cancelSubscriptionStep)279 subscriber3.add_step(subscriber3.cancelSubscriptionStep)280 tester.add_step(tester.stopSession)281 subscriber.add_step(subscriber.stopSession)282 subscriber2.add_step(subscriber2.stopSession)283 subscriber3.add_step(subscriber3.stopSession)284 tester.add_step(tester.disconnect)285 subscriber.add_step(subscriber.disconnect)286 subscriber2.add_step(subscriber2.disconnect)287 subscriber3.add_step(subscriber3.disconnect)288 tm.add_tester(tester)289 tm.add_tester(subscriber)290 tm.add_tester(subscriber2)291 tm.add_tester(subscriber3)292 tm.run()293 def test_notify_same_path(self):294 """295 Four testers are subscribed for the same notifications. The changes296 are generated when the request from the first of them arrives.297 """298 tm = TestManager()299 tester = SysrepoTester("Tester", sr.SR_DS_RUNNING, False)300 subscriber = NotificationTester("Subscriber")301 subscriber2 = NotificationTester("Subscriber2")302 subscriber3 = NotificationTester("Subscriber3")303 subscriber4 = NotificationTester("Subscriber4")304 tester.add_step(tester.waitStep)305 subscriber.add_step(subscriber.subscribeStep, "ietf-interfaces",306 "/ietf-interfaces:interfaces")307 subscriber2.add_step(subscriber2.waitStep)308 subscriber3.add_step(subscriber3.waitStep)309 subscriber4.add_step(subscriber4.waitStep)310 tester.add_step(tester.waitStep)311 subscriber.add_step(subscriber.waitStep)312 subscriber2.add_step(subscriber2.subscribeStep, "ietf-interfaces",313 "/ietf-interfaces:interfaces")314 subscriber3.add_step(subscriber3.waitStep)315 subscriber4.add_step(subscriber4.waitStep)316 tester.add_step(tester.waitStep)317 subscriber.add_step(subscriber.waitStep)318 subscriber2.add_step(subscriber2.waitStep)319 subscriber3.add_step(subscriber3.subscribeStep, "ietf-interfaces",320 "/ietf-interfaces:interfaces")321 subscriber4.add_step(subscriber4.waitStep)322 tester.add_step(tester.waitStep)323 subscriber.add_step(subscriber.waitStep)324 subscriber2.add_step(subscriber2.waitStep)325 subscriber3.add_step(subscriber3.waitStep)326 subscriber4.add_step(subscriber4.subscribeStep, "ietf-interfaces",327 "/ietf-interfaces:interfaces")328 tester.add_step(tester.deleteItemStep,329 "/ietf-interfaces:interfaces/interface[name='eth0']")330 subscriber.add_step(subscriber.waitStep)331 subscriber2.add_step(subscriber2.waitStep)332 subscriber3.add_step(subscriber3.waitStep)333 subscriber4.add_step(subscriber4.waitStep)334 tester.add_step(tester.commitStep)335 subscriber.add_step(subscriber.waitStep)336 subscriber2.add_step(subscriber2.waitStep)337 subscriber3.add_step(subscriber3.waitStep)338 subscriber4.add_step(subscriber4.waitStep)339 expected_changes = [["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']"],340 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/name"],341 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/type"],342 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/description"],343 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/enabled"],344 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4"],345 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']"],346 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']/ip"],347 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/address[ip='192.168.2.100']/prefix-length"],348 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled"],349 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/mtu"],350 ["DELETED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/forwarding"]]351 tester.add_step(tester.waitStep)352 subscriber.add_step(subscriber.checkNotificationStep, expected_changes)353 subscriber2.add_step(354 subscriber2.checkNotificationStep, expected_changes)355 subscriber3.add_step(356 subscriber3.checkNotificationStep, expected_changes)357 subscriber4.add_step(358 subscriber4.checkNotificationStep, expected_changes)359 tester.add_step(tester.waitStep)360 subscriber.add_step(subscriber.cancelSubscriptionStep)361 subscriber2.add_step(subscriber2.cancelSubscriptionStep)362 subscriber3.add_step(subscriber3.cancelSubscriptionStep)363 subscriber4.add_step(subscriber4.cancelSubscriptionStep)364 tester.add_step(tester.stopSession)365 subscriber.add_step(subscriber.stopSession)366 subscriber2.add_step(subscriber2.stopSession)367 subscriber3.add_step(subscriber3.stopSession)368 subscriber4.add_step(subscriber4.stopSession)369 tester.add_step(tester.disconnect)370 subscriber.add_step(subscriber.disconnect)371 subscriber2.add_step(subscriber2.disconnect)372 subscriber3.add_step(subscriber3.disconnect)373 subscriber4.add_step(subscriber4.disconnect)374 tm.add_tester(tester)375 tm.add_tester(subscriber)376 tm.add_tester(subscriber2)377 tm.add_tester(subscriber3)378 tm.add_tester(subscriber4)379 tm.run()380 def test_delete_default_node(self):381 tm = TestManager()382 tester = SysrepoTester("Tester", sr.SR_DS_RUNNING, False)383 subscriber = NotificationTester("Subscriber")384 tester.add_step(tester.waitStep)385 subscriber.add_step(subscriber.subscribeStep, "ietf-interfaces",386 "/ietf-interfaces:interfaces")387 tester.add_step(388 tester.setItemStep, "/ietf-interfaces:interfaces/interface[name='eth0']/type", sr.Val("iana-if-type:ethernetCsmacd", sr.SR_IDENTITYREF_T))389 subscriber.add_step(subscriber.waitStep)390 tester.add_step(391 tester.setItemStep, "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled", sr.Val(False, sr.SR_BOOL_T))392 subscriber.add_step(subscriber.waitStep)393 tester.add_step(tester.commitStep)394 subscriber.add_step(subscriber.waitStep)395 tester.add_step(tester.deleteItemStep,396 "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/enabled")397 subscriber.add_step(subscriber.waitStep)398 tester.add_step(tester.commitStep)399 subscriber.add_step(subscriber.waitStep)400 tester.add_step(tester.waitStep)401 subscriber.add_step(subscriber.checkNotificationStep, [402 ["MODIFIED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/forwarding"]])403 tester.add_step(tester.waitStep)404 subscriber.add_step(subscriber.cancelSubscriptionStep)405 tester.add_step(tester.stopSession)406 subscriber.add_step(subscriber.stopSession)407 tester.add_step(tester.disconnect)408 subscriber.add_step(subscriber.disconnect)409 tm.add_tester(tester)410 tm.add_tester(subscriber)411 tm.run()412 def test_change_default_node(self):413 tm = TestManager()414 tester = SysrepoTester("Tester", sr.SR_DS_RUNNING, False)415 subscriber = NotificationTester("Subscriber")416 tester.add_step(tester.waitStep)417 subscriber.add_step(subscriber.subscribeStep, "ietf-interfaces",418 "/ietf-interfaces:interfaces")419 tester.add_step(420 tester.setItemStep, "/ietf-interfaces:interfaces/interface[name='eth0']/type", sr.Val("iana-if-type:ethernetCsmacd", sr.SR_IDENTITYREF_T))421 subscriber.add_step(subscriber.waitStep)422 tester.add_step(423 tester.setItemStep, "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/forwarding", sr.Val(True, sr.SR_BOOL_T))424 subscriber.add_step(subscriber.waitStep)425 tester.add_step(tester.commitStep)426 subscriber.add_step(subscriber.waitStep)427 tester.add_step(tester.waitStep)428 subscriber.add_step(subscriber.checkNotificationStep, [429 ["MODIFIED", "/ietf-interfaces:interfaces/interface[name='eth0']/ietf-ip:ipv4/forwarding"]])430 tester.add_step(tester.waitStep)431 subscriber.add_step(subscriber.cancelSubscriptionStep)432 tester.add_step(tester.stopSession)433 subscriber.add_step(subscriber.stopSession)434 tester.add_step(tester.disconnect)435 subscriber.add_step(subscriber.disconnect)436 tm.add_tester(tester)437 tm.add_tester(subscriber)438 tm.run()439if __name__ == '__main__':...
construct.py
Source:construct.py
...74 # make debug-[DRC_STEP] or make debug-[LVS_STEP]75 #-----------------------------------------------------------------------76 # Graph -- Add nodes77 #-----------------------------------------------------------------------78 g.add_step( info )79 g.add_step( rtl )80 g.add_step( testbench )81 g.add_step( rtl_sim )82 g.add_step( constraints )83 g.add_step( dc )84 g.add_step( iflow )85 g.add_step( init )86 g.add_step( power )87 g.add_step( place )88 g.add_step( cts )89 g.add_step( postcts_hold )90 g.add_step( route )91 g.add_step( postroute )92 g.add_step( signoff )93 g.add_step( genlibdb )94 g.add_step( gdsmerge )95 g.add_step( drc )96 g.add_step( lvs )97 g.add_step( pt_timing )98 g.add_step( gen_saif_rtl )99 g.add_step( pt_power_rtl )100 g.add_step( gl_sim )101 g.add_step( gen_saif_gl )102 g.add_step( pt_power_gl )103 #-----------------------------------------------------------------------104 # Graph -- Add edges105 #-----------------------------------------------------------------------106 107 # Dynamically add edges108 rtl_sim.extend_inputs(['design.v'])109 rtl_sim.extend_inputs(['test_vectors.txt'])110 # Connect by name111 g.connect_by_name( adk, dc )112 g.connect_by_name( adk, iflow )113 g.connect_by_name( adk, init )114 g.connect_by_name( adk, power )115 g.connect_by_name( adk, place )116 g.connect_by_name( adk, cts )...
flow.py
Source:flow.py
...93 info.set_name('build-info')94 #-----------------------------------------------------------------------95 # Graph -- Add nodes96 #-----------------------------------------------------------------------97 g.add_step( info )98 g.add_step( gather )99 g.add_step( rtlsim )100 g.add_step( synth )101 g.add_step( glFFsim )102 g.add_step( init )103 g.add_step( floorplan )104 g.add_step( powergrid )105 g.add_step( pnr )106 g.add_step( signoff )107 # g.add_step( glBAsim )108 g.add_step( synthpower )109 # g.add_step( pnrpower )110 g.add_step( summary )111 #-----------------------------------------------------------------------112 # Graph -- Add edges113 #-----------------------------------------------------------------------114 # Connect by name115 g.connect_by_name( adk, synth )116 g.connect_by_name( adk, glFFsim )117 g.connect_by_name( adk, init )118 g.connect_by_name( adk, floorplan )119 g.connect_by_name( adk, powergrid )120 g.connect_by_name( adk, pnr )121 g.connect_by_name( adk, signoff )122 # g.connect_by_name( adk, glBAsim )123 g.connect_by_name( adk, synthpower )124 # g.connect_by_name( adk, pnrpower )...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!