covalent icon indicating copy to clipboard operation
covalent copied to clipboard

Unit tests for electron.py

Open scottwn opened this issue 2 years ago • 1 comments

Acceptance criteria

  • [ ] Test TYPE_CHECKING = True
  • [x] Test the Electron iterator with expected_unpack_values = 2
  • [ ] Test getattr with a non--- attribute
  • [ ] Test getitem
  • [ ] Test passing backend argument to electron()

scottwn avatar Jun 21 '22 19:06 scottwn

When trying to write the getattr tests, I saw this comment that refers to "magic functions". What is a magic function? https://github.com/AgnostiqHQ/covalent/blob/62920abba32457e0f8049cf2baa2f63ffbdf8c83/covalent/_workflow/electron.py#L246-L250

scottwn avatar Jul 06 '22 18:07 scottwn

Hey, could I take this? I'll work on building tests init, set_metadata, and get_metadata. I'll try to understand Electrons better when I'm doing that so I can create a few more tests later on.

ShreyBiswas avatar Oct 01 '22 12:10 ShreyBiswas

Hey, could I take this? I'll work on building tests init, set_metadata, and get_metadata. I'll try to understand Electrons better when I'm doing that so I can create a few more tests later on.

Hi @StreakSharn, that would be great! I'm going to add your name beside the tests you're interested in. And if you're interested in adding more tests later, feel free to let me know.

Feel free to reach out if you have any questions.

Really appreciate your contribution! 😃

FyzHsn avatar Oct 01 '22 16:10 FyzHsn

Thanks! I was following CONTRIBUTING.md, and I don't quite understand a problem I'm having. When running python setup.py webapp after executing all the previous steps, I get: running webapp error: [WinError 2] The system cannot find the file specified

I haven't made changes apart from adding encoding='utf-8' to setup.py, since it couldn't decode README.md. Would you know what file the system can't find, and how I could solve the error?

ShreyBiswas avatar Oct 02 '22 14:10 ShreyBiswas

Hi @StreakSharn, one thing I can think of is to check whether you're running python setup.py webapp from the root covalent directory. If you're in some other subdirectory, that might explain why the system is not able to find the specified file.

Let me know if that fixes it!

FyzHsn avatar Oct 03 '22 13:10 FyzHsn

@StreakSharn the WinError suggests to me you are using Windows. Covalent does not currently support Windows. For a list of supported platforms, see this page.

wjcunningham7 avatar Oct 19 '22 17:10 wjcunningham7