<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhinav on Medium]]></title>
        <description><![CDATA[Stories by Abhinav on Medium]]></description>
        <link>https://medium.com/@a_bhi_9?source=rss-a501ac02a36d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8jVL1f5o822aGyDuNN4KJg.jpeg</url>
            <title>Stories by Abhinav on Medium</title>
            <link>https://medium.com/@a_bhi_9?source=rss-a501ac02a36d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 18:50:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a_bhi_9/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Passing the AWS Certified Cloud Practitioner in 48 hours]]></title>
            <link>https://medium.com/@a_bhi_9/passing-the-aws-certified-cloud-practitioner-in-48-hours-27b1e1cfe7a1?source=rss-a501ac02a36d------2</link>
            <guid isPermaLink="false">https://medium.com/p/27b1e1cfe7a1</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[aws-ccp]]></category>
            <dc:creator><![CDATA[Abhinav]]></dc:creator>
            <pubDate>Fri, 10 Jul 2020 00:52:33 GMT</pubDate>
            <atom:updated>2020-07-10T00:52:33.025Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WcYfmT9pztAsFMfxK5NVDg.png" /></figure><h3>What is AWS Certified Practitioner?</h3><p>Amazon Web Services (AWS) is one of the de-facto Cloud Computing standards in today’s tech world. About 2 million companies worldwide use AWS to connect with their customers, render their services, or perform the computation for their applications. You interact with one or more of the AWS services even if you know it or not.</p><p>It is inevitable today that companies look for engineers with not just the knowledge but also with credentials that prove this knowledge worthwhile.</p><p>Amazon has introduced various certifications, not only to help engineers validate their knowledge but also to make it an industry standard to recognize professionals. The first of these exams is the Amazon Web Services (AWS) Certified Cloud Practitioner (CCP).</p><blockquote>The AWS Certified Cloud Practitioner examination is intended for individuals who have the knowledge and skills necessary to effectively demonstrate an overall understanding of the AWS Cloud, independent of specific technical roles addressed by other AWS Certifications.</blockquote><h3>What does AWS expect you to know for the exam?</h3><p>Like any other certification, passing the AWS CCP will let you demonstrate your AWS skills and will be a testament to your knowledge of the various AWS services. Since CCP is the first of the many AWS certifications and for everyone who interacts with AWS services in the company, from sales, support, and developers alike, the emphasis of this exam is on the various AWS services.</p><p>The exam and its preparation will take you through the entire AWS offering but a few. The whole point of the exercise will be to make you aware of the kind of service you can use or offer to your client to solve their business problem.</p><p>Apart from the services, AWS has designed what is calls the Well-Architected Framework. It enlists everything that a well-architected AWS stack should look like. Along with the Well-Architected Framework, the major emphasis lies on the roles and responsibilities of both Amazon and the user while using the cloud infrastructure. As with every product, costing is of paramount importance. The CCP exam makes you aware of the general concept of AWS cloud infrastructure and how you will harness the different solutions to offer a solution suitable for your client in a secure and cost-effective manner.</p><h3><strong>How did I prepare for the exam in less than 3 days?</strong></h3><p>Like with any other exam, knowing what you are studying helps a lot. You need to understand what AWS expects out of you. The best way to do this is to read through the exam syllabus available online.</p><ol><li><a href="https://d1.awsstatic.com/training-and-certification/docs-cloud-practitioner/AWS-Certified-Cloud-Practitioner_Exam-Guide.pdf">https://d1.awsstatic.com/training-and-certification/docs-cloud-practitioner/AWS-Certified-Cloud-Practitioner_Exam-Guide.pdf</a></li></ol><p>Once you are through with the syllabus, you will have a general understanding of what AWS is looking for. After this, you will need to find a great online study course. I highly recommend <a href="https://www.udemy.com/user/stephane-maarek/">Stephane Maarek</a>’s course on Udemy. Not only are his courses concise but very informative and highly focussed on how you can crack the exam.</p><p>2. <a href="https://www.udemy.com/course/aws-certified-cloud-practitioner-new/">https://www.udemy.com/course/aws-certified-cloud-practitioner-new/</a></p><p>In my opinion, go through only one course and stick to it. Make sure you have covered the entire course thoroughly and that take plenty of notes. In my case, I penned down a lot of flashcards and diagrams to quickly understand and revise the content.</p><p>Nothing better at this stage to practice for the final exam. A day before the exam, deep dive into your notes and start taking mock tests. There is one available for free from AWS.</p><p>3. <a href="https://d1.awsstatic.com/training-and-certification/docs-cloud-practitioner/AWS-Certified-Cloud-Practitioner_Sample-Questions.pdf">https://d1.awsstatic.com/training-and-certification/docs-cloud-practitioner/AWS-Certified-Cloud-Practitioner_Sample-Questions.pdf</a></p><p>Another one that you can take advantage of is Whizlabs. They have a very thorough exam simulator that will set you in a pseudo-exam like situation and make you act as if you are appearing for the real exam. The first exam they offer is free after which you’ll need to buy additional exams. I cannot stress enough how important this investment is.</p><p>4. <a href="https://www.whizlabs.com/aws-certified-cloud-practitioner/">https://www.whizlabs.com/aws-certified-cloud-practitioner/</a></p><p>Along with this exam, the quizzes by Stephane Mareek during the length of his course is also something you should rely on. This will let you evaluate whatever you have learned in the course.</p><p>As with any exam, the more you interact with AWS the better your chances of understanding what you are learning. Open a free-tier AWS account and start playing around with the services. This will deepen your understanding of the AWS offering and make you adept at answering use case-based questions.</p><p>If you have time at hand, I would strongly recommend reading the white paper. It will give you a deeper understanding of the services and prepare you for those twisted confusing questions which makes you believe more than one answer fits the bill.</p><p>All in all, this is a relatively easy exam as compared to the other AWS certifications. But cracking it will give you the boost needed to go and grab the others.</p><p>I appeared for the exam from the comfort of my home and I would recommend doing that unless you have a good reason to go to the exam center. This will help you calm your nerves and give you ample of known surroundings’ advantage. But make sure you are prepared and so are your surroundings before starting the exam.</p><p>In the end, it’s never too early to start preparing. Keep your concepts clear and make sure you revise the topics time and again.</p><p>Best of luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27b1e1cfe7a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Versioning your dot files — Saving precious time for getting up and running]]></title>
            <link>https://medium.com/@a_bhi_9/versioning-your-dot-files-saving-precious-time-for-getting-up-and-running-dc1712d5d700?source=rss-a501ac02a36d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc1712d5d700</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Abhinav]]></dc:creator>
            <pubDate>Wed, 21 Oct 2015 14:07:20 GMT</pubDate>
            <atom:updated>2015-10-21T14:07:20.702Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever been in a situation where you accidentally deleted the contents of your HOME folder?</p><p>Ever experienced a crash that wiped off all your settings?</p><p>Well, been there and done that. After heckling across various internal storage where the system stores cached copies of my bashrc settings I figured out that it is not entirely a fail-safe method.</p><p>Somehow, as it turns out, the genius of versioning such files struck me.</p><p>So currently, I have versioned all my SSH keys and my .bashrc file. These two are vital for me to function, and no matter where I am working, all I need to do is simply clone these files and <em>voilà</em>, I am ready to roll.</p><p>There are plenty of options which you can use apart from versioning, the very basic, syncing it across your Dropbox or Google Drive. For geeks who like things to be versioned, and having a history of how things were, and are, bitbucket and github prove impetus.</p><p>PS: There is a CRON that runs on my system every day to check if my repository is always up to date with the local version.</p><p><em>Originally published at </em><a href="https://datqaguy.wordpress.com/2015/10/14/dot-files-versioning/"><em>datqaguy.wordpress.com</em></a><em> on October 14, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc1712d5d700" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python’s LEGB Rule]]></title>
            <link>https://medium.com/@a_bhi_9/python-s-legb-rule-70a1b8000006?source=rss-a501ac02a36d------2</link>
            <guid isPermaLink="false">https://medium.com/p/70a1b8000006</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Abhinav]]></dc:creator>
            <pubDate>Wed, 21 Oct 2015 14:05:05 GMT</pubDate>
            <atom:updated>2015-10-21T14:05:05.155Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I was working on a piece of code when I had problems debugging it. The usual resort lies in going through all of stackoverflow questions to see if there is someone in some part of the world in the same state as you.</p><p>Eventually, I stumbled upon a question to which the response was so perfect I couldn’t help but write about it.</p><p>Here is that response. <a href="http://stackoverflow.com/a/18864212/1534201">http://stackoverflow.com/a/18864212/1534201</a></p><p>The most amazing part about this response lies in the last paragraph. The LEGB rule.</p><p>As programmers, at times we tend to forget how the workflow of the code is. This LEGB rule is a gentle reminder of how simple things are.</p><p>Local -&gt; Enclosing -&gt; Global -&gt; Built-in.</p><p>Happy coding.</p><p><em>Originally published at </em><a href="https://datqaguy.wordpress.com/2015/10/08/python-lego-rule/"><em>datqaguy.wordpress.com</em></a><em> on October 8, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70a1b8000006" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decorators — The way life gets simpler!]]></title>
            <link>https://medium.com/@a_bhi_9/decorators-the-way-life-gets-simpler-f98672da3cab?source=rss-a501ac02a36d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f98672da3cab</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Abhinav]]></dc:creator>
            <pubDate>Wed, 21 Oct 2015 14:01:30 GMT</pubDate>
            <atom:updated>2015-10-21T14:02:42.869Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I was working on a module in a project that had a certain check to be performed each time I interacted with the UI.</p><p>The most simple thing I could have done was to create a proper function that returned me the result of this interaction or create a simple <em>lambda</em>. Both the cases beat the purpose of this beautiful language. Hence, I decided it is about time that I venture into something that makes it looks more <em>Python</em>-ic if you may. I used decorators.</p><p>Decorators at their very heart are objects which consume objects and return objects. These objects could be anything. In my case, a <em>WebElement</em>. It returns me a plethora of objects (I created more than one decorator) like, <em>boolean</em>, <em>strings</em>, the list goes on.</p><p>Enough speaking, now the code.</p><pre>from functools import wraps </pre><pre>def wrapper(f): <br>    @wraps(f): <br>    def wrapping(*args): <br>        .... <br>        .... <br>        .... <br>        return some_value # This return is the heart and soul of<br>                          # your decorator <br>    return wrapping </pre><pre>@wrapper <br>def my_weak_function(*args, **kwargs): <br>    .... <br>    .... <br>    .... <br>    return awesome_results</pre><p>In the code above, the,</p><pre>return some_value</pre><p>is what provides that extra power to <em>my_weak_function()</em>‘s punch!</p><p>My problem was something else, I had to declare a wrapper for a class. And how did I do that?</p><pre>def awesome_wrapper(func): <br>    def awesome_power(self): <br>        .... <br>        .... <br>        .... <br>        return func(self) <br>    return awesome_power </pre><pre>class Dummy(object): <br>    def __init__(self): <br>        .... <br>        .... <br>        .... </pre><pre>    @awesome_wrapper <br>    def non_awesome_function(self): <br>        .... <br>        .... <br>        ....</pre><p>Here, what is important is the part,</p><pre>return func(self)</pre><p>This guarantees that the function on which the decorator was applied is executed. Passing <em>self</em> might be an eye-sore, but it’s the way to assure the unbound methods get the necessary class instances to work with.</p><p>Hope you use decorators in your next modules, and moreover, they look bloody good ;)</p><p>For further reading, refer:</p><p>[1] <a href="http://www.jeffknupp.com/blog/2013/11/29/improve-your-python-decorators-explained/">http://www.jeffknupp.com/blog/2013/11/29/improve-your-python-decorators-explained/</a></p><p>[2] <a href="http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/">http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/</a></p><p><em>Originally published at </em><a href="https://datqaguy.wordpress.com/2015/10/07/decorators-the-way/"><em>datqaguy.wordpress.com</em></a><em> on October 7, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f98672da3cab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memoizing using decorators in Python]]></title>
            <link>https://medium.com/@a_bhi_9/memoizing-using-decorators-in-python-f11af77e8644?source=rss-a501ac02a36d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f11af77e8644</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Abhinav]]></dc:creator>
            <pubDate>Wed, 21 Oct 2015 13:56:22 GMT</pubDate>
            <atom:updated>2015-10-21T14:03:47.259Z</atom:updated>
            <content:encoded><![CDATA[<p>I came across this topic during one of our developer’s stand-up griefs. Digging into this topic led me to discover the concept of memoization in computing.</p><p>Basically to cut the story short, this is nothing but caching in its simplest terms. The only difference lies in the use of this caching.</p><p>I have compiled a way in which any object can be memoized.</p><pre>import collections <br>from functools import wraps </pre><pre>def memoize(obj): <br>    cache = obj.cache = {} </pre><pre>    @wraps(obj) <br>    def memoizer(*args, **kwargs): <br>        print &quot;Initial cache: &quot; + str(cache) </pre><pre>        for _1 in args: <br>            if not isinstance(_1, collections.Hashable): <br>                print &quot;UNCACHEABLE!!&quot; <br>                return obj(*args, **kwargs) </pre><pre>            if (str(args) + str(kwargs)) in obj.cache: <br>                print &quot;Found in cache&quot; <br>                return obj.cache[str(args) + str(kwargs)] <br>            else: <br>                print &quot;Not found in cache&quot; <br>                value = obj(*args, **kwargs) <br>                obj.cache[str(args) + str(kwargs)] = value <br>                print &quot;Updated cache: &quot; + str(obj.cache) <br>                return value </pre><pre>    return memoizer</pre><p>Use this as a decorator for your function or class by simply appending <em>@memoize</em> before the definition.</p><p>For further reading, refer:</p><p>[1] <a href="https://wiki.python.org/moin/PythonDecoratorLibrary#memoize">https://wiki.python.org/moin/PythonDecoratorLibrary#memoize</a></p><p><em>Originally published at </em><a href="https://datqaguy.wordpress.com/2015/08/20/python-memoize-tutorial/"><em>datqaguy.wordpress.com</em></a><em> on August 20, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f11af77e8644" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[functools.partial — Smart alternative to lambda]]></title>
            <link>https://medium.com/@a_bhi_9/functools-partial-smart-alternative-to-lambda-ccd4d2687a44?source=rss-a501ac02a36d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccd4d2687a44</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Abhinav]]></dc:creator>
            <pubDate>Wed, 21 Oct 2015 13:51:24 GMT</pubDate>
            <atom:updated>2015-10-21T13:51:24.689Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I was browsing through the recipes of Python decorators when I came across a rather interesting function.</p><pre>functools.partial()</pre><p>It spurred me up because to be very honest I have never seen how it works or what it does.</p><p>After an hour of digging into the matter, starting off from <a href="https://docs.python.org/2/library/functools.html#functools.partial">Python docs</a> to <a href="http://stackoverflow.com/search?q=functools+partial">stackoverflow.com</a> to various <a href="https://duckduckgo.com/?q=how+does+functools.partial+work+-stackoverflow">other blogs</a>, the journey to understand the subtle topic was fun.</p><p>Below I have tried to explain partial by means of a code example and a link to the best answer I found on the internet.</p><pre>&gt;&gt; def convert_to_int(some_value, int_base): <br>       return int(some_value, base=int_base) </pre><pre>&gt;&gt; convert_to_int(&quot;1010&quot;, 2) <br>&gt;&gt; 10 </pre><pre>&gt;&gt; convert_to_int(&quot;1010&quot;, 8) <br>&gt;&gt; 520 </pre><pre>&gt;&gt; convert_to_int(&quot;1010&quot;, 10) <br>&gt;&gt; 1010 </pre><pre>&gt;&gt; from functools import partial </pre><pre>&gt;&gt; str2bin = partial(convert_to_int, int_base=2) <br>&gt;&gt; str2bin(&quot;1010&quot;) <br>&gt;&gt; 10 </pre><pre>&gt;&gt; str2oct = partial(convert_to_int, int_base=8) <br>&gt;&gt; str2oct(&quot;1010&quot;) <br>&gt;&gt; 520 </pre><pre>&gt;&gt; str2dec = partial(convert_to_int, int_base=10) <br>&gt;&gt; str2dec(&quot;1010&quot;) <br>&gt;&gt; 1010</pre><p>So it must be pretty how and what partial does, but why?</p><p>This is one amazing part that the creators of Python share on <a href="http://stackoverflow.com/questions/3252228/python-why-is-functools-partial-necessary?lq=1">stackoverflow.com</a></p><p>While the best response and explanation about partial is as mentioned <a href="http://stackoverflow.com/questions/15331726/how-does-the-functools-partial-work-in-python">here</a>.</p><p>PS: Happy coding!</p><p><em>Originally published at </em><a href="https://datqaguy.wordpress.com/2015/08/20/python-partial-tutorial/"><em>datqaguy.wordpress.com</em></a><em> on August 20, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccd4d2687a44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using FitNesse’s SLIM protocol to write functional tests in Python]]></title>
            <link>https://medium.com/@a_bhi_9/using-fitnesse-s-slim-protocol-to-write-functional-tests-in-python-b4cfb195b821?source=rss-a501ac02a36d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4cfb195b821</guid>
            <category><![CDATA[test]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Abhinav]]></dc:creator>
            <pubDate>Wed, 21 Oct 2015 13:48:08 GMT</pubDate>
            <atom:updated>2015-10-21T13:48:59.430Z</atom:updated>
            <content:encoded><![CDATA[<p>I was searching the internet to look for the tutorial that would help me get started with writing FitNesse tests using Python. TO my dismay there weren’t many that made sense to me. So after 3 days of struggle to find some good resources, I finally managed to kick some FitNesse!</p><p>Requirements:</p><ul><li>Python 2.6 +</li><li>Setuptools — easy_install: This would help us to install the wrapper for SLIM, <em>waferslim</em>.</li><li>waferslim: You can get the last updated version of waferslim either from <a href="https://pypi.python.org/pypi/waferslim">cheese shop</a> or <a href="https://launchpad.net/waferslim">launchpad</a>.</li><li>fitnesse: <a href="http://fitnesse.org/fitnesse-standalone.jar?responder=releaseDownload&amp;release=20150814">Download</a> the fitness standalone from fitnesse’s official website.</li></ul><p>Once we have all these, let’s go ahead and create our first fitness page.</p><p>Let us organise our directories like this.</p><pre>/Users/ <br>   |----redmond/ <br>      |----fitnesseTests/ <br>         |----Calc/ <br>         |----fitnesse-standalone.jar</pre><p>Once the directories are organised, let’s start to perform the setup.</p><pre>mkdir ~/fitnesseTests </pre><pre>cd ~/fitnesseTests </pre><pre>mkdir Calc</pre><p>Before creating the fitness page, let’s install waferslim using setuptools.</p><pre>wget <a href="http://pypi.python.org/packages/2.6/w/waferslim/waferslim-1.0.2-py2.6.egg">http://pypi.python.org/packages/2.6/w/waferslim/waferslim-1.0.2-py2.6.egg</a></pre><p>Now we have waferslim egg in the fitnesseTests directory.</p><p>Using easy_install let us install it.</p><pre>python <a href="http://usr/local/lib/python2.7/site-packages/easy_install.py">http:///usr/local/lib/python2.7/site-packages/easy_install.py</a> waferslim-1.0.2-py2.6</pre><p>This will install waferslim in the current python environment.</p><p>Once waferslim is installed it is time to start editing the wiki pages.</p><p>Start the fitness server</p><pre>java -jar fitnesse-standalone.jar -v -p 8080</pre><p>A long trail of startup code should be visible now.</p><p>Fire up a browser and go to <a href="http://localhost:8080/"><em>http://localhost:8080</em></a>, the FitNesse front page should be displayed.</p><p>Click on <em>Edit</em> and add a wiki word like <em>Calc</em> and save the page.</p><p>The Calc will have a question mark after it suggesting us to create a page.</p><p>Click on the question mark, a new page’s editor will open.</p><p>Fill in the page using the code below</p><pre>!1 This is a demo for fitnesse <br>!2 Use this page as a reference. </pre><pre>!3 Variable Setup <br>!define TEST_SYSTEM {slim} <br>!define SLIM_VERSION {0.1} <br>!path /Users/redmond/fitnesseTests/ <br>!define COMMAND_PATTERN {python -m waferslim.server --syspath %p} </pre><pre>!3 Imports <br>|import | <br>|waferslim.examples.decision_table| <br>|Calc.Calc | </pre><pre>|Calc | <br>|A|B|multiply?| <br>|1|2|2 | <br>|1|0|0 | <br>|3|5|15 | <br>|5|5|26 |</pre><p>Once this part is done, you can click on Test to execute the tests on this page, but it will show you an error.</p><p>To link it to our python fixtures we need to write some pythonic code that will execute behind the scene and validate our test.</p><p>As we have to multiply two numbers and obtain its results, we need to create a class Calc in Calc.py that will reside in Calc/</p><pre>cd Calc </pre><pre>touch __init__.py </pre><pre>touch Calc.py</pre><p>Using your favorite editor type in the following code in Calc.py and save it.</p><pre>from waferslim.converters import convert_arg, convert_result, StrConverter </pre><pre>_STR_CONVERTER = StrConverter() </pre><pre>class Calc(object): <br>    def __init__(self): <br>        self._A = 0 <br>        self._B = 0 <br>    <br>    @convert_arg(to_type=int) <br>    def setA(self, A):<br>        self._A = A</pre><pre>    @convert_arg(to_type=int) <br>    def setB(self, B):<br>        self._B = B </pre><pre>    @convert_result(using=_STR_CONVERTER) <br>    def multiply(self): <br>        return self._A * self._B </pre><pre>    def execute(self): <br>        print &quot;Execute function&quot; </pre><pre>    def reset(self): <br>        print &quot;Reset function&quot; </pre><p>Once this is saved, go back to the test page and click on Test.</p><p>This time the test should connect to our class and execute it.</p><p>For more information and syntax, refer:</p><p>[1] Test driven development blog @ <a href="http://withaherring.blogspot.fr/">http://withaherring.blogspot.fr/</a></p><p>[2] Waferslim’s launchpad page @ <a href="https://launchpad.net/waferslim/">https://launchpad.net/waferslim/</a></p><p>[3] FitNesse tutorials @ <a href="http://fitnesse.org/FitNesse.FullReferenceGuide/">http://fitnesse.org/FitNesse.FullReferenceGuide/</a></p><p><em>Originally published at </em><a href="https://datqaguy.wordpress.com/2015/08/18/finesse-test-using-slim-and-python/"><em>datqaguy.wordpress.com</em></a><em> on August 18, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4cfb195b821" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>