Coverage for src/robotide/namespace/embeddedargs.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-05-06 10:40 +0100

1# Copyright 2008-2015 Nokia Networks 

2# Copyright 2016- Robot Framework Foundation 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); 

5# you may not use this file except in compliance with the License. 

6# You may obtain a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, 

12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

13# See the License for the specific language governing permissions and 

14# limitations under the License. 

15 

16from robotide.lib.robot.running.arguments.embedded import EmbeddedArgumentParser 1aI

17 

18 

19class EmbeddedArgsHandler(object): 1aI

20 

21 def __init__(self, keyword): 1aI

22 if keyword.arguments: 1abfghijklmnopqrstuvwxyzABCFGDEHcde

23 # raise TypeError('Cannot have normal arguments') 

24 print('DEBUG: Found normal arguments in embedded arguments keyword.') 1abDcde

25 # print(f'DEBUG: embeddedargs.py EmbeddedArgsHandler keyword={keyword.name} longname={keyword.longname}') 

26 self.name_regexp, self.embedded_args = EmbeddedArgumentParser().parse(keyword.name) 1abfghijklmnopqrstuvwxyzABCFGDEHcde

27 if hasattr(keyword, 'longname'): 1abfghijklmnopqrstuvwxyzABCFGDEHcde

28 self.longname_regexp, _ = EmbeddedArgumentParser().parse(keyword.longname) 1abfghijklmnopqrstuvwxyzABCcde

29 if not self.embedded_args: 1abfghijklmnopqrstuvwxyzABCFGDEHcde

30 raise TypeError('Must have embedded arguments') 1E