[Tutor] Introductory questions on test-driven development and implementing Git version control.

boB Stepp robertvstepp at gmail.com
Sat Apr 25 17:58:14 CEST 2015


On Sat, Apr 25, 2015 at 3:20 AM, Laura Creighton <lac at openend.se> wrote:
> In a message of Fri, 24 Apr 2015 20:24:38 -0500, boB Stepp writes:

>>The Python versions at work are 2.4.4 and 2.6.4(?)(Not certain about
>>the last digit there.) Based on responses to date, the fact that
>>unittest is in the standard library and that because of this most of
>>my books have something about unittest, I will probably start there. I
>>imagine that everything I learn with unittest will transfer over to
>>other testing frameworks.
>
> What is even better, should you wake up one morning and decide that
> you really want pytest, I written have a script that automatically converts
> unittests to pytest tests.  It is included with the pytest distribution.

This is very good to know!

>>> Are you absolutely certain that you cannot install git on your bare-bones
>>> Solaris 10 environments?  Or plug in a memory stick and run code from
>>> there?  Because it would make your life so much easier ...

On your original post this did not register in my brain properly. This
might be possible. The thin clients that hook us to Smart Enterprise
*do* have a couple of USB ports. I know that they are functional as I
watched the installer using one. I will have to investigate this!

>>I think that I can get an exception here (See a post in response that
>>I made earlier today.). What I am *certain* of, is that I cannot
>>install anything on our clinical planning environment. The Solaris
>>workstation that I now have all to myself--I'm thinking they will now
>>let me do what I want with it. But I must double check... But anything
>>I develop there *should* work in the clinical environment. The
>>planning software is the same though that may change soon as there are
>>plans to go up a version and they may not want to do that on my
>>testing/development machine.
>
> This thought 'if it works here, it ought to work there' is an unworthy
> thought for somebody who has learned to test their code. ;)  You go to your
> new machine.  You pull down your tests and your code.  You run all your
> tests.  When they pass, you don't just _think_ that the code _ought to_
> run here -- you _know_ the code will run because it passes all its tests.

You have a very gentle way of chastising me! ~(:>))

I *do* test when I transfer code to the production environment, but to
date these have all been manual. And the whole point here is for me to
learn how to do full-fledged automated testing. And if there is ever a
place to ensure I do this, it is in the production environment! But I
did not see how to make it work there. Perhaps the memory stick idea
or Alan's SCCS can get around these difficulties.

> So we have got to find you a way that works to get your tests and a way
> to run them on your production machines.
>
> Is there a way to stick a memory stick into these machines?  Can you
> mount a filesystem there and cd to it?...

As I said above, I will see if this is doable. The ports exist, but
are they usable?

> ...So we keep all the code we care about on our memory
> sticks, indeed in a virtualenv on our memory sticks.  Solaris has
> virtualenv -- I checked -- see
> http://www.opencsw.org/packages/CSWpy-virtualenv/

I have only messed around with a virtual environment once a few years
ago for some project at home that I no longer recall the details for.
I did not get very deeply into understanding things, so I would have
some learning curve here.

On a different testing-related note, I have read that it is a good
idea sometimes to do one's code testing within the confines of a
virtual environment for safety reasons, particularly if some code
comes from outside sources? Would you mind speaking to that topic?

> So, right now, aside from a mandate from on high that people who
> plug memory sticks into their computers shall be boiled in oil, or
> the situation where your machines don't have any external ports at all,
> I cannot see why this solution wouldn't work for you.

There might be some who would enjoy doing this! ~(:>))

IS is a bit sensitive about the use of memory sticks. We have had
multiple instances of virus infections via this route, often from
people who really should have known better. But I am pleased to report
I have not been one of them! (Keeping fingers crossed, knocking on
wood, etc.)

-- 
boB


More information about the Tutor mailing list