Skip to content

Mock#183

Closed
peendebak wants to merge 3 commits intomasterfrom
mock2
Closed

Mock#183
peendebak wants to merge 3 commits intomasterfrom
mock2

Conversation

@peendebak
Copy link
Contributor

This adds a get_attribute to the MockModel. A corresponding set_attribute should be implemented.

@peendebak peendebak mentioned this pull request May 18, 2016
@alexcjohnson
Copy link
Contributor

@peendebak a bunch of the code around this is changing in #159 - do you mind if we wait until that is merged and we can insert all the functionality of #167 in the updated framework?

@peendebak
Copy link
Contributor Author

@alexcjohnson Waiting a little is fine with me.

Maybe a more generic form of the functionality could be implemented in #159 already? In this PR I pass on getattr to the server, but there are many other functions (or classes) for which this might be usefull.


def get_attribute(self, name):
''' Get an attribute from the model (server side) '''
return self.ask('_magicget:%s' % (name, ))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy Issue found: Trailing whitespace

@qcodes-bot
Copy link

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 5


Complexity increasing per file
==============================
- qcodes/instrument/mock.py  2

See the complete overview on Codacy

def call_function(self, name, *args):
''' Call a function from the model (server side) '''
return self.ask('_magiccall:%s' % (name, ), *args)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy Issue found: Trailing whitespace

@alexcjohnson
Copy link
Contributor

replaced by #261 (and mooted anyway)

@alexcjohnson alexcjohnson deleted the mock2 branch July 25, 2016 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants